#include <bits/stdc++.h>
using namespace std;
int n, q, a[100010], str[4][255], l1, l2, l3, pos[30];
int table[100010][30], f[255][255][255], id, c;
char s[100010], opt[3], ch[3];
int main() {
  scanf("%d %d", &n, &q);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    a[i] = s[i] - 'a';
  }
  for (int i = 0; i < 26; i++) {
    pos[i] = n + 1;
    table[n + 1][i] = n + 1;
  }
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      table[i][j] = pos[j];
    }
    pos[a[i]] = i;
  }
  while (q--) {
    scanf("%s", opt);
    if (opt[0] == '+') {
      scanf("%d %s", &id, ch);
      c = ch[0] - 'a';
      if (id == 1) {
        str[1][++l1] = c;
        for (int i = 0; i <= l2; i++) {
          for (int j = 0; j <= l3; j++) {
            f[l1][i][j] = table[f[l1 - 1][i][j]][c];
            if (i != 0) {
              f[l1][i][j] = min(f[l1][i][j], table[f[l1][i - 1][j]][str[2][i]]);
            }
            if (j != 0) {
              f[l1][i][j] = min(f[l1][i][j], table[f[l1][i][j - 1]][str[3][j]]);
            }
          }
        }
      } else if (id == 2) {
        str[2][++l2] = c;
        for (int i = 0; i <= l1; i++) {
          for (int j = 0; j <= l3; j++) {
            f[i][l2][j] = table[f[i][l2 - 1][j]][c];
            if (i != 0) {
              f[i][l2][j] = min(f[i][l2][j], table[f[i - 1][l2][j]][str[1][i]]);
            }
            if (j != 0) {
              f[i][l2][j] = min(f[i][l2][j], table[f[i][l2][j - 1]][str[3][j]]);
            }
          }
        }
      } else {
        str[3][++l3] = c;
        for (int i = 0; i <= l1; i++) {
          for (int j = 0; j <= l2; j++) {
            f[i][j][l3] = table[f[i][j][l3 - 1]][c];
            if (i != 0) {
              f[i][j][l3] = min(f[i][j][l3], table[f[i - 1][j][l3]][str[1][i]]);
            }
            if (j != 0) {
              f[i][j][l3] = min(f[i][j][l3], table[f[i][j - 1][l3]][str[2][j]]);
            }
          }
        }
      }
    } else {
      scanf("%d", &id);
      if (id == 1) {
        l1--;
      } else if (id == 2) {
        l2--;
      } else {
        l3--;
      }
    }
    if (f[l1][l2][l3] <= n) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
