#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
char str[100005];
int trie[100005][28];
char s[4][100005];
int top[4];
int up[4];
int down[4];
int dp[305][305][305];
char op;
char tmp;
int main() {
  int n, q;
  cin >> n >> q;
  cin >> (str + 1);
  for (int i = 0; i <= 26; i++) {
    trie[n + 1][i] = trie[n + 2][i] = n + 1;
  }
  str[0] = 0;
  for (int i = n; i >= 0; i--) {
    int cur = str[i] - 'a';
    for (int j = 0; j < 26; j++) {
      if (j == cur) {
        trie[i][j] = i;
      } else {
        trie[i][j] = trie[i + 1][j];
      }
    }
  }
  memset(dp, 0x3f, sizeof dp);
  dp[0][0][0] = 0;
  while (q--) {
    int id;
    cin >> op;
    if (op == '+') {
      cin >> id >> tmp;
      s[id][++top[id]] = tmp;
      for (int i = 1; i <= 3; i++) {
        if (i == id) {
          down[i] = top[i];
        } else {
          down[i] = 0;
        }
        up[i] = top[i];
      }
      for (int i = down[1]; i <= up[1]; i++) {
        for (int j = down[2]; j <= up[2]; j++) {
          for (int k = down[3]; k <= up[3]; k++) {
            dp[i][j][k] = n + 1;
            if (i) {
              dp[i][j][k] =
                  min(dp[i][j][k], trie[dp[i - 1][j][k] + 1][s[1][i] - 'a']);
            }
            if (j) {
              dp[i][j][k] =
                  min(dp[i][j][k], trie[dp[i][j - 1][k] + 1][s[2][j] - 'a']);
            }
            if (k) {
              dp[i][j][k] =
                  min(dp[i][j][k], trie[dp[i][j][k - 1] + 1][s[3][k] - 'a']);
            }
          }
        }
      }
    } else {
      cin >> id;
      top[id]--;
    }
    if (dp[top[1]][top[2]][top[3]] > n) {
      cout << "NO" << endl;
      ;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
