#include <bits/stdc++.h>
using namespace std;
const int mxN = 100001, mxM = 256, C = 26;
inline void ckmin(int &a, int b) {
  if (a > b) a = b;
}
inline void ckmax(int &a, int b) {
  if (a < b) a = b;
}
int nxt[mxN][C], pos[C];
char s[mxN], op[1], c[1];
int dp[mxM][mxM][mxM];
int len[3], sub[3][mxM], n, m;
inline void build() {
  int i, j;
  for (i = 0; i < 26; ++i) nxt[n + 1][i] = pos[i] = n + 1;
  for (i = n; ~i; --i) {
    for (j = 0; j < 26; ++j) nxt[i][j] = pos[j];
    if (i) pos[s[i] - 'a'] = i;
  }
}
inline void upd(int a, int b, int c) {
  int &t = dp[a][b][c];
  t = n + 1;
  if (a) ckmin(t, nxt[dp[a - 1][b][c]][sub[0][a]]);
  if (b) ckmin(t, nxt[dp[a][b - 1][c]][sub[1][b]]);
  if (c) ckmin(t, nxt[dp[a][b][c - 1]][sub[2][c]]);
}
inline void add(int id) {
  scanf("%s", c);
  int val = c[0] - 'a', a, b, c;
  sub[id][++len[id]] = val;
  int mn0 = id == 0 ? len[0] : 0;
  int mn1 = id == 1 ? len[1] : 0;
  int mn2 = id == 2 ? len[2] : 0;
  for (a = mn0; a <= len[0]; ++a)
    for (b = mn1; b <= len[1]; ++b)
      for (c = mn2; c <= len[2]; ++c) upd(a, b, c);
}
inline void del(int id) { --len[id]; }
int main() {
  int i, j, id;
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  build();
  for (i = 1; i <= m; ++i) {
    scanf("%s%d", op, &j);
    --j;
    if (op[0] == '+')
      add(j);
    else
      del(j);
    puts(dp[len[0]][len[1]][len[2]] <= n ? "YES" : "NO");
  }
}
