#include <bits/stdc++.h>
using namespace std;
const int oo = 2139063143;
const int N = 101000, M = 255;
const int P = 1000000007;
const double eps = 1e-7;
template <typename T>
inline void sc(T &x) {
  x = 0;
  static int p;
  p = 1;
  static char c;
  c = getchar();
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c - 48);
    c = getchar();
  }
  x *= p;
}
template <typename T>
inline void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void pr(T x) {
  print(x), putchar('\n');
}
template <typename T1, typename T2>
void chkmax(T1 &A, T2 B) {
  A = A >= B ? A : B;
}
template <typename T1, typename T2>
void chkmin(T1 &A, T2 B) {
  A = A <= B ? A : B;
}
int f[M][M][M], h[N][27], a[4][M];
char s[N];
int main() {
  int n, m;
  sc(n), sc(m);
  scanf("%s", s + 1);
  for (int i = 1; i <= 26; i++) h[n][i] = h[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--)
    memcpy(h[i - 1], h[i], sizeof(h[i])), h[i - 1][s[i] - 'a' + 1] = i;
  int p[4] = {0};
  while (m--) {
    char op[2];
    scanf("%s", op);
    int id;
    sc(id);
    if (op[0] == '+') {
      scanf("%s", op);
      a[id][++p[id]] = op[0] - 'a' + 1;
      int w[4] = {0};
      w[id] = p[id];
      for (int i = w[1]; i <= p[1]; i++)
        for (int j = w[2]; j <= p[2]; j++)
          for (int k = w[3]; k <= p[3]; k++) f[i][j][k] = n + 1;
      f[0][0][0] = 0;
      if (id == 1 && op[0] == 'd') {
        ++n;
        --n;
      }
      --w[id];
      for (int i = w[1]; i <= p[1]; i++)
        for (int j = w[2]; j <= p[2]; j++)
          for (int k = w[3]; k <= p[3]; k++) {
            if (i < p[1]) chkmin(f[i + 1][j][k], h[f[i][j][k]][a[1][i + 1]]);
            if (j < p[2]) chkmin(f[i][j + 1][k], h[f[i][j][k]][a[2][j + 1]]);
            if (k < p[3]) chkmin(f[i][j][k + 1], h[f[i][j][k]][a[3][k + 1]]);
          }
    } else
      --p[id];
    puts(f[p[1]][p[2]][p[3]] <= n ? "YES" : "NO");
  }
  return 0;
}
