The 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.

If the scientists place a sample of colonies of bacteria on each on Formurosa's 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 | (OR), & (AND) and ^ (XOR). If it is 0, the plant will turn red, otherwise — it will turn blue.

For example, if the nutrition process of Formurosa is described by the formula: (((?^?)|?)&(1^?)); then Formurosa has four leaves (the "?" signs denote the leaves). If we place 0, 1, 0, 0 on the respective leaves, the result of the nutrition process will be (((0^1)|0)&(1^0)) = 1, therefore the plant will turn blue.

The scientists have n colonies of bacteria. They do not know their types; the only thing they know for sure is that not all colonies are of the same type. They want to attempt to determine the bacteria's 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!

Is it possible for them to always determine the species of each colony, no matter what they are (assuming they are not all the same)?

Input

The first line of input contains a single integer n (2 ≤ n ≤ 106) — the number of colonies of bacteria.

The second line contains the formula describing the nutrition process of Formurosa. This line contains only characters «0», «1», «?», «|», «&», «^», «(», «)» and complies with the following grammar:

s → 0|1|?|(s|s)|(s&s)|(s^s)

The formula consists of no more than 106 characters.

Output

If it is always possible to determine the species of each colony, output "YES" (without quotes). Otherwise, output "NO" (without quotes).

Examples

Input

2
(?^?)


Output

NO


Input

10
?


Output

YES


Input

2
((?^?)&amp;?)


Output

YES
#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, l, ans, temp;
char c;
int pos[2000000], st[2000000];
char expr[2000000];
int gettype(int p, int q) {
  int x, left, right;
  if (p == q) {
    if (expr[p] == '0') return 0;
    if (expr[p] == '1') return 1;
    if (expr[p] == '?') return 4;
  }
  x = pos[p];
  left = gettype(p + 1, x - 1);
  right = gettype(x + 1, q - 1);
  if (left > right) {
    temp = left;
    left = right;
    right = temp;
  }
  if (expr[x] == '|') {
    if (left == 0) return right;
    if (left == 1) return 1;
    if (left == 2 && right == 2) return 2;
    return 3;
  }
  if (expr[x] == '&') {
    if (left == 0) return 0;
    if (left == 1) return right;
    if (left == 2 && right == 2) return 2;
    return 3;
  }
  if (expr[x] == '^') {
    if (left == 0 || left == 2) return right;
    if (left == 1)
      if (right == 1)
        return 0;
      else
        return right;
    if (left == 3) return 3;
    if (left == 4) return 2;
  }
}
int main() {
  scanf("%d", &n);
  l = 0;
  scanf("%c", &c);
  while (c == '\n') scanf("%c", &c);
  while (c != '\n') {
    l++;
    expr[l] = c;
    scanf("%c", &c);
  }
  k = 0;
  for (i = 1; i <= l; i++) {
    if (expr[i] == '(') {
      k++;
      st[k] = i;
    }
    if (expr[i] == ')') {
      st[k] = 0;
      k--;
    }
    if (expr[i] == '|' || expr[i] == '&' || expr[i] == '^') pos[st[k]] = i;
  }
  ans = gettype(1, l);
  if (ans >= 3)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
