#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 2;
const int maxm = 250 + 2;
const int ABC = 26;
int n, q;
char str[maxn];
int cnt[5], low[5];
int nxt[maxn][ABC], a[maxm][5];
int dp[maxm][maxm][maxm];
int change(char ch) { return ch - 'a'; }
int main() {
  scanf("%d%d%s", &n, &q, str + 1);
  for (int i = 0; i < ABC; i++) nxt[n][i] = nxt[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < ABC; j++) nxt[i - 1][j] = nxt[i][j];
    nxt[i - 1][change(str[i])] = i;
  }
  dp[0][0][0] = 0;
  while (q--) {
    char type[2], ch[2];
    int num;
    scanf("%s%d", &type, &num);
    if (type[0] == '-') cnt[num]--;
    if (type[0] == '+') {
      scanf("%s", ch);
      a[++cnt[num]][num] = change(ch[0]);
      memset(low, 0, sizeof(low));
      low[num] = cnt[num];
      for (int i = low[1]; i <= cnt[1]; i++)
        for (int j = low[2]; j <= cnt[2]; j++)
          for (int k = low[3]; k <= cnt[3]; k++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] = min(dp[i][j][k], nxt[dp[i - 1][j][k]][a[i][1]]);
            if (j)
              dp[i][j][k] = min(dp[i][j][k], nxt[dp[i][j - 1][k]][a[j][2]]);
            if (k)
              dp[i][j][k] = min(dp[i][j][k], nxt[dp[i][j][k - 1]][a[k][3]]);
          }
    }
    if (dp[cnt[1]][cnt[2]][cnt[3]] <= n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
