{"raw_statement":[{"iden":"problem statement","content":"Ms. AtCoder has decided to distribute chocolates to $N$ friends on Valentine's Day. For the $i$\\-th friend $(1 \\leq i \\leq N)$, she wants to give a square chocolate bar of size $2^{A_i} \\times 2^{A_i}$.\nShe has procured a rectangular chocolate bar of size $H \\times W$. It is partitioned by lines into a grid of $H$ rows and $W$ columns, each cell being a $1 \\times 1$ square.\nDetermine whether it is possible to divide the chocolate bar along the lines into several pieces to obtain all the chocolate bars for her friends. It is fine to have leftover pieces."},{"iden":"constraints","content":"*   $1 \\leq H \\leq 10^9$\n*   $1 \\leq W \\leq 10^9$\n*   $1 \\leq N \\leq 1000$\n*   $0 \\leq A_i \\leq 25 \\ (1 \\leq i \\leq N)$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H$ $W$ $N$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4 4 4\n1 0 0 1"},{"iden":"sample output 1","content":"Yes\n\nBy dividing a $4 \\times 4$ chocolate bar as shown in the figure below, you can obtain pieces of size $2 \\times 2, 1 \\times 1, 1 \\times 1, 2 \\times 2$.\n![image](https://img.atcoder.jp/arc172/46f487245ec72edd225e4e6b36cb7600.png)"},{"iden":"sample input 2","content":"5 7 6\n0 1 0 2 0 1"},{"iden":"sample output 2","content":"Yes\n\nBy dividing a $5 \\times 7$ chocolate bar as shown in the figure below, you can obtain pieces of size $1 \\times 1, 2 \\times 2, 1 \\times 1, 4 \\times 4, 1 \\times 1, 2 \\times 2$.\n![image](https://img.atcoder.jp/arc172/4c2ab4192df6687b23e2d68d318868bb.png)"},{"iden":"sample input 3","content":"3 2 7\n0 0 0 0 0 0 0"},{"iden":"sample output 3","content":"No\n\nIt is impossible to obtain seven pieces of size $1 \\times 1$ from a $3 \\times 2$ chocolate bar."},{"iden":"sample input 4","content":"11 11 2\n2 3"},{"iden":"sample output 4","content":"No\n\nIt is impossible to obtain both a $4 \\times 4$ and an $8 \\times 8$ piece from an $11 \\times 11$ chocolate bar."},{"iden":"sample input 5","content":"777 777 6\n8 6 9 1 2 0"},{"iden":"sample output 5","content":"Yes"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}