{"problem":{"name":"XXYYX","description":{"content":"Determine whether there is a string $S$ of length $N$ consisting of `X` and `Y` that satisfies the following condition. **Condition:** Among the $(N - 1)$ pairs of consecutive characters in $S$, *   ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc157_a"},"statements":[{"statement_type":"Markdown","content":"Determine whether there is a string $S$ of length $N$ consisting of `X` and `Y` that satisfies the following condition.\n**Condition:** Among the $(N - 1)$ pairs of consecutive characters in $S$,\n\n*   exactly $A$ are `XX`,\n*   exactly $B$ are `XY`,\n*   exactly $C$ are `YX`, and\n*   exactly $D$ are `YY`.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $A \\geq 0$\n*   $B \\geq 0$\n*   $C \\geq 0$\n*   $D \\geq 0$\n*   $A + B + C + D = N - 1$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $A$ $B$ $C$ $D$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc157_a","tags":[],"sample_group":[["5 1 1 1 1","Yes\n\nFor instance, if $S = {}$`XXYYX`, the pairs of consecutive characters are `XX`, `XY`, `YY`, and `YX` from left to right. Each pattern occurs exactly once, so the condition is satisfied."],["5 1 2 1 0","Yes\n\nFor instance, $S = {}$`XXYXY` satisfies the condition."],["5 0 4 0 0","No\n\nNo string satisfies the condition."]],"created_at":"2026-03-03 11:01:14"}}