#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long nm = 0;
  bool fh = true;
  char cw = getchar();
  for (; !isdigit(cw); cw = getchar()) fh ^= (cw == '-');
  for (; isdigit(cw); cw = getchar()) nm = nm * 10 + (cw - '0');
  return fh ? nm : -nm;
}
inline char readcw() {
  char cw = getchar();
  for (; (cw ^ '+') && (cw ^ '-') && (cw < 'a' || cw > 'z'); cw = getchar())
    ;
  return cw;
}
int n, Q, F[252][252][252], last[252], nt[100020][32], Top1, Top2, Top3;
char ch[100020], S1[252], S2[252], S3[252];
inline void update(int x) {
  for (int i = (x == 1) ? Top1 - 1 : 0; i <= Top1; i++)
    for (int j = (x == 2) ? Top2 - 1 : 0; j <= Top2; j++)
      for (int k = (x == 3) ? Top3 - 1 : 0; k <= Top3; k++) {
        if (i + j + k > 0)
          F[i][j][k] = n + 1;
        else
          F[i][j][k] = 0;
        if (i > 0 && F[i - 1][j][k] < n)
          F[i][j][k] = min(F[i][j][k], nt[F[i - 1][j][k]][S1[i] - 'a']);
        if (j > 0 && F[i][j - 1][k] < n)
          F[i][j][k] = min(F[i][j][k], nt[F[i][j - 1][k]][S2[j] - 'a']);
        if (k > 0 && F[i][j][k - 1] < n)
          F[i][j][k] = min(F[i][j][k], nt[F[i][j][k - 1]][S3[k] - 'a']);
      }
}
int main() {
  n = read(), Q = read(), scanf("%s", ch + 1);
  for (int i = 0; i < 26; i++) last[i] = n + 1;
  for (int i = n; ~i; --i) {
    memcpy(nt[i], last, sizeof(nt[i]));
    if (i) last[ch[i] - 'a'] = i;
  }
  while (Q--) {
    char op = readcw(), cw;
    int x;
    if (op == '+') {
      x = read(), cw = readcw();
      if (x == 1) S1[++Top1] = cw;
      if (x == 2) S2[++Top2] = cw;
      if (x == 3) S3[++Top3] = cw;
      update(x);
    } else {
      x = read();
      if (x == 1) --Top1;
      if (x == 2) --Top2;
      if (x == 3) --Top3;
    }
    puts(F[Top1][Top2][Top3] <= n ? "YES" : "NO");
  }
  return 0;
}
