{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThe Bytelandian Institute for Biological Research (BIBR) is investigating the properties of two species of bacteria, named simply 0 and 1. Even under a microscope, bacteria of those two species are very difficult to distinguish. In fact, the only thing the scientists possess that is able to differentiate between them is a plant called Formurosa.\u003c/p\u003e\u003cp\u003eIf the scientists place a sample of colonies of bacteria on each on Formurosa\u0027s leaves, it will activate a complicated nutrition process. During that process color of Formurosa changes to reflect the result of a — possibly very complicated — logical formula on the species of bacteria, involving constants and the operators \u003cspan class\u003d\"tex-span\"\u003e|\u003c/span\u003e (OR), \u003cspan class\u003d\"tex-span\"\u003e\u0026amp;\u003c/span\u003e (AND) and \u003cspan class\u003d\"tex-span\"\u003e^\u003c/span\u003e (XOR). If it is 0, the plant will turn red, otherwise — it will turn blue.\u003c/p\u003e\u003cp\u003eFor example, if the nutrition process of Formurosa is described by the formula: \u003cspan class\u003d\"tex-span\"\u003e(((?^?)|?)\u0026amp;(1^?))\u003c/span\u003e; then Formurosa has four leaves (the \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e?\u003c/span\u003e\" signs denote the leaves). If we place \u003cspan class\u003d\"tex-span\"\u003e0, 1, 0, 0\u003c/span\u003e on the respective leaves, the result of the nutrition process will be \u003cspan class\u003d\"tex-span\"\u003e(((0^1)|0)\u0026amp;(1^0)) \u003d 1\u003c/span\u003e, therefore the plant will turn blue.\u003c/p\u003e\u003cp\u003eThe scientists have \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e colonies of bacteria. They do not know their types; the only thing they know for sure is that \u003cspan class\u003d\"tex-font-style-bf\"\u003enot all colonies are of the same type\u003c/span\u003e. They want to attempt to determine the bacteria\u0027s species by repeated evaluations with Formurosa. During each evaluation they must place exactly one sample on every leaf of the plant. However, they may use multiple samples of one colony during a single evaluation; they can even cover the whole plant with bacteria from one colony!\u003c/p\u003e\u003cp\u003eIs it possible for them to always determine the species of each colony, no matter what they are (assuming they are not all the same)?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of input contains a single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e2 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e6\u003c/sup\u003e\u003c/span\u003e) — the number of colonies of bacteria.\u003c/p\u003e\u003cp\u003eThe second line contains the formula describing the nutrition process of Formurosa. This line contains only characters «\u003cspan class\u003d\"tex-font-style-tt\"\u003e0\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e1\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e?\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e|\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026amp;\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e^\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e(\u003c/span\u003e», «\u003cspan class\u003d\"tex-font-style-tt\"\u003e)\u003c/span\u003e» and complies with the following grammar:\u003c/p\u003e\u003ccenter class\u003d\"tex-equation\"\u003e\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e → 0|1|?|(\u003ci\u003es\u003c/i\u003e|\u003ci\u003es\u003c/i\u003e)|(\u003ci\u003es\u003c/i\u003e\u0026amp;\u003ci\u003es\u003c/i\u003e)|(\u003ci\u003es\u003c/i\u003e^\u003ci\u003es\u003c/i\u003e)\u003c/span\u003e\u003c/center\u003e\u003cp\u003eThe formula consists of no more than \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e6\u003c/sup\u003e\u003c/span\u003e characters.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is always possible to determine the species of each colony, output \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" (without quotes). Otherwise, output \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\" (without quotes).\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n(?^?)\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e10\n?\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n((?^?)\u0026amp;?)\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}