#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const int maxm = 256;
void chkmin(int &x, int y) { x = x > y ? y : x; }
int nxt[maxn][26], pos[26];
char S[maxn], op[1], ch[1];
int dp[maxm][maxm][maxm];
int len[3], sub[3][maxm], n, m;
void Build() {
  for (int i = 0; i < 26; ++i) nxt[n + 1][i] = pos[i] = n + 1;
  for (int i = n; ~i; --i) {
    for (int j = 0; j < 26; ++j) nxt[i][j] = pos[j];
    if (i) pos[S[i] - 'a'] = i;
  }
}
void Update(int a, int b, int c) {
  int &val = dp[a][b][c];
  val = n + 1;
  if (a) chkmin(val, nxt[dp[a - 1][b][c]][sub[0][a]]);
  if (b) chkmin(val, nxt[dp[a][b - 1][c]][sub[1][b]]);
  if (c) chkmin(val, nxt[dp[a][b][c - 1]][sub[2][c]]);
}
void Add(int id) {
  scanf("%s", ch);
  int val = ch[0] - 'a';
  sub[id][++len[id]] = val;
  int min0 = id == 0 ? len[0] : 0;
  int min1 = id == 1 ? len[1] : 0;
  int min2 = id == 2 ? len[2] : 0;
  for (int a = min0; a <= len[0]; ++a)
    for (int b = min1; b <= len[1]; ++b)
      for (int c = min2; c <= len[2]; ++c) Update(a, b, c);
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", S + 1);
  Build();
  for (int i = 1, id; i <= m; ++i) {
    scanf("%s%d", op, &id);
    id--;
    if (op[0] == '+') Add(id);
    if (op[0] == '-') len[id]--;
    puts(dp[len[0]][len[1]][len[2]] <= n ? "YES" : "NO");
  }
}
