During the archaeological research in the Middle East you found the traces of three ancient religions: First religion, Second religion and Third religion. You compiled the information on the evolution of each of these beliefs, and you now wonder if the followers of each religion could coexist in peace.

The Word of Universe is a long word containing the lowercase English characters only. At each moment of time, each of the religion beliefs could be described by a word consisting of lowercase English characters.

The three religions can coexist in peace if their descriptions form disjoint subsequences of the Word of Universe. More formally, one can paint some of the characters of the Word of Universe in three colors: 1, 2, 3, so that each character is painted in at most one color, and the description of the i-th religion can be constructed from the Word of Universe by removing all characters that aren't painted in color i.

The religions however evolve. In the beginning, each religion description is empty. Every once in a while, either a character is appended to the end of the description of a single religion, or the last character is dropped from the description. After each change, determine if the religions could coexist in peace.

Input

The first line of the input contains two integers n, q (1 ≤ n ≤ 100 000, 1 ≤ q ≤ 1000) — the length of the Word of Universe and the number of religion evolutions, respectively. The following line contains the Word of Universe — a string of length n consisting of lowercase English characters.

Each of the following line describes a single evolution and is in one of the following formats: 

  * + i c (i ∈ \{1, 2, 3\}, c ∈ \{a, b, ..., z\}: append the character c to the end of i-th religion description. 
  * - i (i ∈ \{1, 2, 3\}) – remove the last character from the i-th religion description. You can assume that the pattern is non-empty. 



You can assume that no religion will have description longer than 250 characters.

Output

Write q lines. The i-th of them should be YES if the religions could coexist in peace after the i-th evolution, or NO otherwise.

You can print each character in any case (either upper or lower).

Examples

Input


6 8
abdabc
+ 1 a
+ 1 d
+ 2 b
+ 2 c
+ 3 a
+ 3 b
+ 1 c
- 2


Output


YES
YES
YES
YES
YES
YES
NO
YES


Input


6 8
abbaab
+ 1 a
+ 2 a
+ 3 a
+ 1 b
+ 2 b
+ 3 b
- 1
+ 2 z


Output


YES
YES
YES
YES
YES
NO
YES
NO

Note

In the first example, after the 6th evolution the religion descriptions are: ad, bc, and ab. The following figure shows how these descriptions form three disjoint subsequences of the Word of Universe:

<image>
#include <bits/stdc++.h>
using namespace std;
int n, m, sl, fh, p[26], num[4], a[4][300], nxt[100010][26], dp[300][300][300];
char c[2], s[100010], ans[2][5] = {{'N', 'O'}, {'Y', 'E', 'S'}};
int rd() {
  sl = 0;
  fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
void upd(int &x, int y) {
  if (x > y) x = y;
}
void upd(int x) {
  a[x][++num[x]] = c[0] - 'a';
  static int bg[4];
  bg[1] = bg[2] = bg[3] = 0;
  bg[x] = num[x];
  for (int i = bg[1]; i <= num[1]; ++i)
    for (int j = bg[2]; j <= num[2]; ++j)
      for (int k = bg[3]; k <= num[3]; ++k) {
        dp[i][j][k] = n + 1;
        if (i && dp[i - 1][j][k] <= n)
          upd(dp[i][j][k], nxt[dp[i - 1][j][k]][a[1][i]]);
        if (j && dp[i][j - 1][k] <= n)
          upd(dp[i][j][k], nxt[dp[i][j - 1][k]][a[2][j]]);
        if (k && dp[i][j][k - 1] <= n)
          upd(dp[i][j][k], nxt[dp[i][j][k - 1]][a[3][k]]);
      }
}
int main() {
  n = rd();
  m = rd();
  scanf("%s", s + 1);
  for (int i = 0; i < 26; ++i) p[i] = n + 1;
  for (int i = n; i; --i) {
    for (int j = 0; j < 26; ++j) nxt[i][j] = p[j];
    p[s[i] - 'a'] = i;
  }
  for (int j = 0; j < 26; ++j) nxt[0][j] = p[j];
  for (int x; m; --m) {
    scanf("%s", c);
    if (c[0] == '+')
      x = rd(), scanf("%s", c), upd(x);
    else
      x = rd(), num[x]--;
    puts(ans[dp[num[1]][num[2]][num[3]] <= n]);
  }
  return 0;
}
