#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
const int MAXL = 300;
const int MAXS = 26;
char s[MAXN], a[4][MAXL];
int l[4], t[MAXS], nxt[MAXN][MAXS];
int f[MAXL][MAXL][MAXL];
int main() {
  int n, q;
  scanf("%d%d%s", &n, &q, s + 1);
  for (int i = 0; i < MAXS; i++) t[i] = n + 1;
  for (int i = n + 1; i >= 0; i--) {
    for (int j = 0; j < MAXS; j++) nxt[i][j] = t[j];
    if (s[i]) t[s[i] - 'a'] = i;
  }
  while (q--) {
    char opt[2], c[2];
    int x;
    scanf("%s%d", opt, &x);
    if (opt[0] == '+') {
      scanf("%s", c);
      a[x][++l[x]] = c[0];
      int s1 = 0, s2 = 0, s3 = 0;
      if (x == 1)
        s1 = l[1];
      else if (x == 2)
        s2 = l[2];
      else
        s3 = l[3];
      for (int i = s1; i <= l[1]; i++)
        for (int j = s2; j <= l[2]; j++)
          for (int k = s3; k <= l[3]; k++) {
            f[i][j][k] = i == 0 && j == 0 && k == 0 ? 0 : n + 1;
            if (i > 0)
              f[i][j][k] = min(f[i][j][k], nxt[f[i - 1][j][k]][a[1][i] - 'a']);
            if (j > 0)
              f[i][j][k] = min(f[i][j][k], nxt[f[i][j - 1][k]][a[2][j] - 'a']);
            if (k > 0)
              f[i][j][k] = min(f[i][j][k], nxt[f[i][j][k - 1]][a[3][k] - 'a']);
          }
    } else
      l[x]--;
    puts(f[l[1]][l[2]][l[3]] <= n ? "YES" : "NO");
  }
  return 0;
}
