#include <bits/stdc++.h>
using namespace std;
const int nsz = 1e5, msz = 250, inf = 0x3f3f3f3f;
int n, m, s[nsz + 5], t[3][nsz + 5], b[nsz + 5], nxt[nsz + 5][26],
    dp[msz + 5][msz + 5][msz + 5], sz[3];
int inline read() {
  int res = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); res *= 10, res += c ^ 48, c = getchar())
    ;
  return res;
}
char inline readc() {
  char c = getchar();
  for (; c != '-' && c != '+' && !isalpha(c); c = getchar())
    ;
  return c;
}
void inline readstr() {
  int sz = 0;
  char c = getchar();
  for (; !isalpha(c); c = getchar())
    ;
  for (; isalpha(c); s[++sz] = c - 'a', c = getchar())
    ;
}
int inline min(int a, int b, int c, int d) { return min(min(a, b), min(c, d)); }
void inline upd(int id) {
  int from[3] = {0, 0, 0};
  from[id] = sz[id] - 1;
  for (int i = from[0]; i <= sz[0]; ++i) {
    for (int j = from[1]; j <= sz[1]; ++j) {
      for (int k = from[2]; k <= sz[2]; ++k) {
        if (!i && !j && !k) continue;
        dp[i][j][k] = min(inf,
                          dp[i - 1][j][k] <= n && i && t[0][i] != -1
                              ? nxt[dp[i - 1][j][k]][t[0][i]]
                              : inf,
                          dp[i][j - 1][k] <= n && j && t[1][j] != -1
                              ? nxt[dp[i][j - 1][k]][t[1][j]]
                              : inf,
                          dp[i][j][k - 1] <= n && k && t[2][k] != -1
                              ? nxt[dp[i][j][k - 1]][t[2][k]]
                              : inf);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  n = read();
  m = read();
  readstr();
  memset(b, inf, sizeof(b));
  memset(dp, inf, sizeof(dp));
  memset(t, -1, sizeof(t));
  dp[0][0][0] = 0;
  for (int i = n; i >= 0; --i) {
    for (int c = 0; c < 26; ++c) {
      nxt[i][c] = b[c];
      if (c == s[i]) {
        b[c] = i;
      }
    }
  }
  for (int i = 1; i <= m; ++i) {
    char cmd = readc();
    int id = read() - 1;
    if (cmd == '+') {
      int c = readc() - 'a';
      t[id][++sz[id]] = c;
      upd(id);
    } else if (cmd == '-') {
      t[id][sz[id]--] = -1;
    }
    bool flag = dp[sz[0]][sz[1]][sz[2]] <= n;
    cout << (flag ? "YES" : "NO") << '\n';
  }
}
