#include <bits/stdc++.h>
using namespace std;
int d[251][251][251], occ[100100][27];
int nxt[27];
char c;
int n, q, x = 0, y = 0, z = 0, k;
string f, g, h;
string s;
char st[100100];
void do_dp(int x, int y, int z) {
  if (x) d[x][y][z] = min(d[x][y][z], occ[d[x - 1][y][z]][f[x]]);
  if (y) d[x][y][z] = min(d[x][y][z], occ[d[x][y - 1][z]][g[y]]);
  if (z) d[x][y][z] = min(d[x][y][z], occ[d[x][y][z - 1]][h[z]]);
}
int main() {
  f.push_back('0'), g.push_back('0'), h.push_back('0');
  for (int i = 0; i < 27; i++) nxt[i] = 1e6;
  for (int i = 0; i <= 250; i++)
    for (int j = 0; j <= 250; j++)
      for (int p = 0; p <= 250; p++) d[i][j][p] = 100010;
  d[0][0][0] = 0;
  cin >> n >> q;
  cin >> s;
  s = " " + s;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < 26; j++) occ[i][j] = nxt[j];
    if (i > 0) nxt[s[i] - 'a'] = i;
  }
  for (int j = 0; j < 26; j++) occ[100010][j] = 1e6;
  while (q--) {
    cin >> c >> k;
    if (c == '+') {
      cin >> c;
      c = c - 'a';
      if (k == 1) {
        x++;
        f.push_back(c);
      }
      if (k == 2) {
        y++;
        g.push_back(c);
      }
      if (k == 3) {
        z++;
        h.push_back(c);
      }
      int min1, min2, min3;
      min1 = min2 = min3 = 0;
      if (k == 1) min1 = x;
      if (k == 2) min2 = y;
      if (k == 3) min3 = z;
      for (int i = min1; i <= x; i++) {
        for (int j = min2; j <= y; j++) {
          for (int p = min3; p <= z; p++) {
            do_dp(i, j, p);
          }
        }
      }
    } else {
      int min1, min2, min3;
      min1 = min2 = min3 = 0;
      if (k == 1) min1 = x;
      if (k == 2) min2 = y;
      if (k == 3) min3 = z;
      for (int i = min1; i <= x; i++) {
        for (int j = min2; j <= y; j++) {
          for (int p = min3; p <= z; p++) {
            d[i][j][p] = 100010;
          }
        }
      }
      if (k == 1) {
        x--;
        f.pop_back();
      }
      if (k == 2) {
        y--;
        g.pop_back();
      }
      if (k == 3) {
        z--;
        h.pop_back();
      }
    }
    if (d[x][y][z] < 100010)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
