#include <bits/stdc++.h>
using namespace std;
int dp[251][251][251];
char str[1000000];
char s[4][300];
int cpos[30], nt_pos[1000000][30];
int n, q;
void init() {
  for (int i = 0; i < 26; ++i) {
    cpos[i] = n + 1;
  }
  for (int i = n; i >= 0; --i) {
    for (int j = 0; j < 26; ++j) {
      nt_pos[i][j] = cpos[j];
    }
    if (i == 0) break;
    cpos[str[i] - 'a'] = i;
  }
}
int nt(int pos, char c) {
  if (pos > n) return pos;
  return nt_pos[pos][c - 'a'];
}
int min_t(int a, int b) {
  if (a == -1) return b;
  if (b == -1) return a;
  return min(a, b);
}
int start[4], pos[4];
int main() {
  cin >> n >> q;
  cin >> str + 1;
  init();
  memset(dp, -1, sizeof(dp));
  dp[0][0][0] = 0;
  while (q--) {
    int c;
    char op, x;
    cin >> op >> c;
    if (op == '+') {
      cin >> x;
      pos[c]++;
      s[c][pos[c]] = x;
      memset(start, 0, sizeof(start));
      start[c] = pos[c] - 1;
      for (int i = start[1]; i <= pos[1]; ++i) {
        for (int j = start[2]; j <= pos[2]; ++j) {
          for (int k = start[3]; k <= pos[3]; ++k) {
            if (dp[i][j][k] == -1) continue;
            if (i + 1 <= pos[1])
              dp[i + 1][j][k] =
                  min_t(nt(dp[i][j][k], s[1][i + 1]), dp[i + 1][j][k]);
            if (j + 1 <= pos[2])
              dp[i][j + 1][k] =
                  min_t(nt(dp[i][j][k], s[2][j + 1]), dp[i][j + 1][k]);
            if (k + 1 <= pos[3])
              dp[i][j][k + 1] =
                  min_t(nt(dp[i][j][k], s[3][k + 1]), dp[i][j][k + 1]);
          }
        }
      }
      if (dp[pos[1]][pos[2]][pos[3]] <= n) {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
    } else {
      memset(start, 0, sizeof(start));
      start[c] = pos[c];
      for (int i = start[1]; i <= pos[1]; ++i)
        for (int j = start[2]; j <= pos[2]; ++j)
          for (int k = start[3]; k <= pos[3]; ++k) dp[i][j][k] = -1;
      pos[c]--;
      if (dp[pos[1]][pos[2]][pos[3]] <= n) {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
    }
  }
}
