#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 250 + 5;
int n, q;
char s[N], d[5][M];
int len[5], nxt[N][30];
int dp[M][M][M];
int main() {
  while (~scanf("%d%d%s", &n, &q, s)) {
    memset(len, 0, sizeof(len));
    for (int i = 0; i <= 25; i++) nxt[n][i] = nxt[n + 1][i] = n + 1;
    for (int i = n - 1; i >= 0; i--) {
      for (int j = 0; j <= 25; j++) nxt[i][j] = nxt[i + 1][j];
      nxt[i][s[i] - 'a'] = i + 1;
    }
    while (q--) {
      char op;
      int id;
      scanf(" %c %d", &op, &id);
      if (op == '-')
        len[id]--;
      else {
        len[id]++;
        scanf(" %c", &op);
        d[id][len[id]] = op;
        int l1, l2, l3;
        l1 = l2 = l3 = 0;
        if (id == 1) l1 = len[1];
        if (id == 2) l2 = len[2];
        if (id == 3) l3 = len[3];
        for (int i = l1; i <= len[1]; i++)
          for (int j = l2; j <= len[2]; j++)
            for (int k = l3; k <= len[3]; k++) {
              dp[i][j][k] = n + 1;
              int pre, ch;
              if (i) {
                pre = dp[i - 1][j][k];
                ch = d[1][i] - 'a';
                dp[i][j][k] = min(nxt[pre][ch], dp[i][j][k]);
              }
              if (j) {
                pre = dp[i][j - 1][k];
                ch = d[2][j] - 'a';
                dp[i][j][k] = min(nxt[pre][ch], dp[i][j][k]);
              }
              if (k) {
                pre = dp[i][j][k - 1];
                ch = d[3][k] - 'a';
                dp[i][j][k] = min(nxt[pre][ch], dp[i][j][k]);
              }
            }
      }
      if (dp[len[1]][len[2]][len[3]] <= n)
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
