{"raw_statement":[{"iden":"problem statement","content":"There is a grid of $H$ rows and $W$ columns, each cell having a side length of $1$, and we have $N$ tiles.  \nThe $i$\\-th tile ($1\\leq i\\leq N$) is a rectangle of size $A_i\\times B_i$.  \nDetermine whether it is possible to place the tiles on the grid so that all of the following conditions are satisfied:\n\n*   Every cell is covered by exactly one tile.\n*   It is fine to have unused tiles.\n*   The tiles **may be rotated or flipped when placed**. However, each tile must be aligned with the edges of the cells without extending outside the grid."},{"iden":"constraints","content":"*   $1\\leq N\\leq 7$\n*   $1 \\leq H,W \\leq 10$\n*   $1\\leq A_i,B_i\\leq 10$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $H$ $W$\n$A_1$ $B_1$\n$A_2$ $B_2$\n$\\ldots$\n$A_N$ $B_N$"},{"iden":"sample input 1","content":"5 5 5\n1 1\n3 3\n4 4\n2 3\n2 5"},{"iden":"sample output 1","content":"Yes\n\nPlacing the $2$\\-nd, $4$\\-th, and $5$\\-th tiles as shown below covers every cell of the grid by exactly one tile.\n![image](https://img.atcoder.jp/abc345/0a0f2829d0485013deabba0103dbd906.png)\nHence, print `Yes`."},{"iden":"sample input 2","content":"1 1 2\n2 3"},{"iden":"sample output 2","content":"No\n\nIt is impossible to place the tile without letting it extend outside the grid.  \nHence, print `No`."},{"iden":"sample input 3","content":"1 2 2\n1 1"},{"iden":"sample output 3","content":"No\n\nIt is impossible to cover all cells with the tile.  \nHence, print `No`."},{"iden":"sample input 4","content":"5 3 3\n1 1\n2 2\n2 2\n2 2\n2 2"},{"iden":"sample output 4","content":"No\n\nNote that each cell must be covered by exactly one tile."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}