{"problem":{"name":"Many Slimes","description":{"content":"We have one slime. You can set the _health_ of this slime to any integer value of your choice. A slime reproduces every second by spawning another slime that has strictly less health. You can freely c","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc140_f"},"statements":[{"statement_type":"Markdown","content":"We have one slime.\nYou can set the _health_ of this slime to any integer value of your choice.\nA slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.\nDetermine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the $2^N$ slimes that will exist in $N$ seconds equals a multiset $S$.\nHere $S$ is a multiset containing $2^N$ (possibly duplicated) integers: $S_1,~S_2,~...,~S_{2^N}$.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 18$\n*   $1 \\leq S_i \\leq 10^9$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S_1$ $S_2$ $...$ $S_{2^N}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc140_f","tags":[],"sample_group":[["2\n4 2 3 1","Yes\n\nWe will show one way to make the multiset of the healths of the slimes that will exist in $2$ seconds equal to $S$.\nFirst, set the health of the first slime to $4$.\nBy letting the first slime spawn a slime whose health is $3$, the healths of the slimes that exist in $1$ second can be $4,~3$.\nThen, by letting the first slime spawn a slime whose health is $2$, and letting the second slime spawn a slime whose health is $1$, the healths of the slimes that exist in $2$ seconds can be $4,~3,~2,~1$, which is equal to $S$ as multisets."],["2\n1 2 3 1","Yes\n\n$S$ may contain multiple instances of the same integer."],["1\n1 1","No"],["5\n4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3","No"]],"created_at":"2026-03-03 11:01:14"}}