{"problem":{"name":"Wrapping Chocolate","description":{"content":"Takahashi has $N$ pieces of chocolate. The $i$\\-th piece has a rectangular shape with a width of $A_i$ centimeters and a length of $B_i$ centimeters.   He also has $M$ boxes. The $i$\\-th box has a rec","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc245_e"},"statements":[{"statement_type":"Markdown","content":"Takahashi has $N$ pieces of chocolate. The $i$\\-th piece has a rectangular shape with a width of $A_i$ centimeters and a length of $B_i$ centimeters.  \nHe also has $M$ boxes. The $i$\\-th box has a rectangular shape with a width of $C_i$ centimeters and a length of $D_i$ centimeters.\nDetermine whether it is possible to put the $N$ pieces of chocolate in the boxes under the conditions below.\n\n*   A box can contain at most one piece of chocolate.\n*   $A_i \\leq C_j$ and $B_i \\leq D_j$ must hold when putting the $i$\\-th piece of chocolate in the $j$\\-th box (they cannot be rotated).\n\n## Constraints\n\n*   $1 \\leq N \\leq M \\leq 2\\times 10^5$\n*   $1 \\leq A_i,B_i,C_i,D_i \\leq 10^9$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $\\ldots$ $A_N$\n$B_1$ $\\ldots$ $B_N$\n$C_1$ $\\ldots$ $C_M$\n$D_1$ $\\ldots$ $D_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc245_e","tags":[],"sample_group":[["2 3\n2 4\n3 2\n8 1 5\n2 10 5","Yes\n\nWe can put the first piece of chocolate in the third box and the second piece in the first box."],["2 2\n1 1\n2 2\n100 1\n100 1","No\n\nA box can contain at most one piece of chocolate."],["1 1\n10\n100\n100\n10","No"],["1 1\n10\n100\n10\n100","Yes"]],"created_at":"2026-03-03 11:01:14"}}