#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 5;
char str[maxn];
int dp[255][255][255];
char A[5][255];
int nxt[maxn][30];
int n[5], N, Q;
void init() {
  for (int i = 0; i <= 26; i++) nxt[N][i] = nxt[N + 1][i] = N;
  for (int i = N - 1; i >= 0; i--) {
    memcpy(nxt[i], nxt[i + 1], sizeof(nxt[i]));
    nxt[i][str[i] - 'a'] = i;
  }
  dp[0][0][0] = -1;
}
void cal(int a, int b, int c) {
  int ch, Min = inf;
  if (a) {
    ch = A[1][a - 1] - 'a';
    Min = min(Min, nxt[dp[a - 1][b][c] + 1][ch]);
  }
  if (b) {
    ch = A[2][b - 1] - 'a';
    Min = min(Min, nxt[dp[a][b - 1][c] + 1][ch]);
  }
  if (c) {
    ch = A[3][c - 1] - 'a';
    Min = min(Min, nxt[dp[a][b][c - 1] + 1][ch]);
  }
  dp[a][b][c] = Min;
}
void solve(int t) {
  int a = n[1], b = n[2], c = n[3];
  for (int i = t == 1 ? a : 0; i <= a; i++)
    for (int j = t == 2 ? b : 0; j <= b; j++)
      for (int k = t == 3 ? c : 0; k <= c; k++) cal(i, j, k);
}
int main() {
  scanf("%d%d", &N, &Q);
  scanf("%s", str);
  init();
  while (Q--) {
    char tem[10];
    int t;
    scanf("%s%d", tem, &t);
    if (tem[0] == '-') {
      n[t]--;
    } else {
      scanf("%s", tem);
      A[t][n[t]++] = tem[0];
      solve(t);
    }
    puts(dp[n[1]][n[2]][n[3]] < N ? "YES" : "NO");
  }
}
