#include <bits/stdc++.h>
using namespace std;
const int maxn = 1123456;
const int maxm = 255;
int n, q, l0, l1, l2;
char s[maxn], op[5];
int nxt[maxn][26], dp[maxm][maxm][maxm];
vector<int> lis[3];
int main() {
  scanf("%d%d", &n, &q);
  scanf("%s", s);
  fill(nxt[n], nxt[n] + 26, n);
  fill(nxt[n + 1], nxt[n + 1] + 26, n);
  for (int(i) = (n - 1); (i) >= (0); (i)--) {
    int idx = s[i] - 'a';
    for (int(j) = (0); (j) <= ((26) - 1); (j)++) {
      nxt[i][j] = nxt[i + 1][j];
      if (j == idx) nxt[i][j] = i;
    }
  }
  dp[0][0][0] = -1;
  while (q--) {
    scanf("%s", op);
    if (op[0] == '+') {
      int idx;
      char ch;
      scanf("%d %c", &idx, &ch);
      idx--;
      ch -= 'a';
      lis[idx].emplace_back(ch);
      switch (idx) {
        case 0: {
          l0++;
          for (int(j) = (0); (j) <= ((l1 + 1) - 1); (j)++)
            for (int(k) = (0); (k) <= ((l2 + 1) - 1); (k)++) {
              dp[l0][j][k] = nxt[dp[l0 - 1][j][k] + 1][ch];
              if (j)
                dp[l0][j][k] =
                    min(dp[l0][j][k], nxt[dp[l0][j - 1][k] + 1][lis[1][j - 1]]);
              if (k)
                dp[l0][j][k] =
                    min(dp[l0][j][k], nxt[dp[l0][j][k - 1] + 1][lis[2][k - 1]]);
            }
          break;
        }
        case 1: {
          l1++;
          for (int(i) = (0); (i) <= ((l0 + 1) - 1); (i)++)
            for (int(k) = (0); (k) <= ((l2 + 1) - 1); (k)++) {
              dp[i][l1][k] = nxt[dp[i][l1 - 1][k] + 1][ch];
              if (i)
                dp[i][l1][k] =
                    min(dp[i][l1][k], nxt[dp[i - 1][l1][k] + 1][lis[0][i - 1]]);
              if (k)
                dp[i][l1][k] =
                    min(dp[i][l1][k], nxt[dp[i][l1][k - 1] + 1][lis[2][k - 1]]);
            }
          break;
        }
        case 2: {
          l2++;
          for (int(i) = (0); (i) <= ((l0 + 1) - 1); (i)++)
            for (int(j) = (0); (j) <= ((l1 + 1) - 1); (j)++) {
              dp[i][j][l2] = nxt[dp[i][j][l2 - 1] + 1][ch];
              if (i)
                dp[i][j][l2] =
                    min(dp[i][j][l2], nxt[dp[i - 1][j][l2] + 1][lis[0][i - 1]]);
              if (j)
                dp[i][j][l2] =
                    min(dp[i][j][l2], nxt[dp[i][j - 1][l2] + 1][lis[1][j - 1]]);
            }
          break;
        }
        default:
          assert(0);
      }
    } else {
      int idx;
      scanf("%d", &idx);
      idx--;
      if (!idx)
        l0--;
      else if (idx == 1)
        l1--;
      else
        l2--;
      lis[idx].pop_back();
    }
    puts(dp[l0][l1][l2] == n ? "NO" : "YES");
  }
}
