#include <bits/stdc++.h>
using namespace std;
char s[100010], S[3][255];
int dp[255][255][255];
int pos[100010][26];
int r[5], st[5];
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  scanf("%s", s + 1);
  for (int i = n + 2; i >= 1; i--) {
    for (int j = 0; j < 26; j++) {
      if (i > n)
        pos[i][j] = n + 1;
      else {
        if (s[i] - 'a' == j)
          pos[i][j] = i;
        else
          pos[i][j] = pos[i + 1][j];
      }
    }
  }
  while (q--) {
    int x;
    char ss;
    scanf(" %c %d", &ss, &x);
    if (ss == '+') {
      char tt;
      scanf(" %c ", &tt);
      S[x][r[x]++] = tt - 'a';
      for (int i = 1; i <= 3; i++) st[i] = 0;
      st[x] = r[x];
      for (int i = st[1]; i <= r[1]; i++) {
        for (int j = st[2]; j <= r[2]; j++) {
          for (int k = st[3]; k <= r[3]; k++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] =
                  min(dp[i][j][k], pos[dp[i - 1][j][k] + 1][S[1][i - 1]]);
            if (j)
              dp[i][j][k] =
                  min(dp[i][j][k], pos[dp[i][j - 1][k] + 1][S[2][j - 1]]);
            if (k)
              dp[i][j][k] =
                  min(dp[i][j][k], pos[dp[i][j][k - 1] + 1][S[3][k - 1]]);
          }
        }
      }
    } else
      r[x]--;
    if (dp[r[1]][r[2]][r[3]] <= n)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
