#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005, maxk = 27, maxm = 255;
int n, q;
int fir[maxn][maxk], len[4], f[maxm][maxm][maxm], s[4][maxm];
string S;
int main() {
  scanf("%d%d", &n, &q);
  cin >> S, S = " " + S;
  for (int i = 1; i <= 26; i++) fir[n + 1][i] = fir[n + 2][i] = n + 1;
  for (int i = n; i >= 1; i--)
    for (int j = 1; j <= 26; j++)
      fir[i][j] = S[i] - 96 == j ? i : fir[i + 1][j];
  while (q--) {
    char t, c;
    int x;
    for (t = getchar(); t != '+' && t != '-'; t = getchar())
      ;
    scanf("%d", &x);
    if (t == '+') {
      for (c = getchar(); c < 'a' || c > 'z'; c = getchar())
        ;
      len[x]++, s[x][len[x]] = c - 96;
      for (int i = x == 1 ? len[1] : 0; i <= len[1]; i++)
        for (int j = x == 2 ? len[2] : 0; j <= len[2]; j++)
          for (int k = x == 3 ? len[3] : 0; k <= len[3]; k++) {
            f[i][j][k] = n + 1;
            f[i][j][k] = min(f[i][j][k],
                             i == 0 ? n + 1 : fir[f[i - 1][j][k] + 1][s[1][i]]);
            f[i][j][k] = min(f[i][j][k],
                             j == 0 ? n + 1 : fir[f[i][j - 1][k] + 1][s[2][j]]);
            f[i][j][k] = min(f[i][j][k],
                             k == 0 ? n + 1 : fir[f[i][j][k - 1] + 1][s[3][k]]);
          }
    } else
      len[x]--;
    puts(f[len[1]][len[2]][len[3]] <= n ? "YES" : "NO");
  }
  return 0;
}
