#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int N = 100005;
const int N2 = 253;
int n, q, i, j, tab[N], res[N2][N2][N2], dl[5], w, bat[N][28], ss[5][N2];
char t[N], t1[10];
int compute(int w1, int w2, int w3) {
  if (res[w1][w2][w3] != -1) {
    return res[w1][w2][w3];
  }
  int r = INF, r1;
  if (w1 > 0) {
    r1 = compute(w1 - 1, w2, w3);
    if (r1 != INF && bat[r1][ss[1][w1]] != -1) r = min(r, bat[r1][ss[1][w1]]);
  }
  if (w2 > 0) {
    r1 = compute(w1, w2 - 1, w3);
    if (r1 != INF && bat[r1][ss[2][w2]] != -1) r = min(r, bat[r1][ss[2][w2]]);
  }
  if (w3 > 0) {
    r1 = compute(w1, w2, w3 - 1);
    if (r1 != INF && bat[r1][ss[3][w3]] != -1) r = min(r, bat[r1][ss[3][w3]]);
  }
  res[w1][w2][w3] = r;
  return r;
}
int main() {
  scanf("%d %d\n", &n, &q);
  scanf("%s\n", t);
  for (i = 0; i < n; i++) tab[i + 1] = int(t[i]) - 'a';
  for (i = 0; i < 26; i++) bat[n][i] = -1;
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < 26; j++) bat[i][j] = bat[i + 1][j];
    bat[i][tab[i + 1]] = i + 1;
  }
  res[0][0][0] = 0;
  dl[1] = dl[2] = dl[3] = 0;
  while (q--) {
    fgets(t1, sizeof(t1), stdin);
    w = int(t1[2]) - '0';
    if (t1[0] == '+') {
      dl[w]++;
      ss[w][dl[w]] = int(t1[4]) - 'a';
      if (w == 1)
        for (i = 0; i <= dl[2]; i++)
          for (j = 0; j <= dl[3]; j++) res[dl[1]][i][j] = -1;
      if (w == 2)
        for (i = 0; i <= dl[1]; i++)
          for (j = 0; j <= dl[3]; j++) res[i][dl[2]][j] = -1;
      if (w == 3)
        for (i = 0; i <= dl[1]; i++)
          for (j = 0; j <= dl[2]; j++) res[i][j][dl[3]] = -1;
      if (compute(dl[1], dl[2], dl[3]) == INF)
        printf("NO\n");
      else
        printf("YES\n");
    } else {
      dl[w]--;
      if (compute(dl[1], dl[2], dl[3]) == INF)
        printf("NO\n");
      else
        printf("YES\n");
    }
  }
  return 0;
}
