#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
inline void umin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
inline void umax(T &x, T y) {
  x = x > y ? x : y;
}
inline unsigned int R() {
  static unsigned int seed = 416;
  return seed ^= seed >> 5, seed ^= seed << 17, seed ^= seed >> 13;
}
const int N = 102000, inf = 0x3f3f3f3f;
int n, q;
char s[N];
int nxt[N][26], f[255][255][255];
int a[N], b[N], c[N];
int A, B, C;
inline void trans(int i, int j, int k) {
  f[i][j][k] = inf;
  if (i > 0) umin(f[i][j][k], nxt[f[i - 1][j][k]][a[i]]);
  if (j > 0) umin(f[i][j][k], nxt[f[i][j - 1][k]][b[j]]);
  if (k > 0) umin(f[i][j][k], nxt[f[i][j][k - 1]][c[k]]);
}
int main() {
  read(n);
  read(q);
  scanf("%s", s + 1);
  for (register int i = (0); i <= (25); i++) nxt[n][i] = nxt[n + 1][i] = n + 1;
  for (register int i = (n); i >= (1); i--) {
    memcpy(nxt[i - 1], nxt[i], 104);
    nxt[i - 1][s[i] - 'a'] = i;
  }
  while (q--) {
    char t[5];
    scanf("%s", t);
    if (t[0] == '+') {
      int id;
      read(id);
      scanf("%s", t);
      int ch = t[0] - 'a';
      if (id == 1) {
        a[++A] = ch;
        for (register int i = (0); i <= (B); i++)
          for (register int j = (0); j <= (C); j++) trans(A, i, j);
      } else if (id == 2) {
        b[++B] = ch;
        for (register int i = (0); i <= (A); i++)
          for (register int k = (0); k <= (C); k++) trans(i, B, k);
      } else {
        c[++C] = ch;
        for (register int i = (0); i <= (A); i++)
          for (register int j = (0); j <= (B); j++) trans(i, j, C);
      }
    } else {
      int id;
      read(id);
      if (id == 1) A--;
      if (id == 2) B--;
      if (id == 3) C--;
    }
    printf("%s\n", f[A][B][C] <= n ? "YES" : "NO");
  }
  return 0;
}
