#include <bits/stdc++.h>
using namespace std;
int dp[300][300][300];
int nxt[100111][30], nas[30];
char str[100111];
int n, q;
vector<int> v[3];
int fun(int a, int b, int c) {
  if (a == 0 && b == 0 && c == 0) return 0;
  int &ret = dp[a][b][c];
  if (ret != -1) return ret;
  ret = (1 << 20);
  if (a > 0) {
    int pos = fun(a - 1, b, c);
    if (pos < n) {
      int cur = nxt[pos][v[0][a - 1]] + 1;
      ret = min(ret, cur);
    }
  }
  if (b > 0) {
    int pos = fun(a, b - 1, c);
    if (pos < n) {
      int cur = nxt[pos][v[1][b - 1]] + 1;
      ret = min(ret, cur);
    }
  }
  if (c > 0) {
    int pos = fun(a, b, c - 1);
    if (pos < n) {
      int cur = nxt[pos][v[2][c - 1]] + 1;
      ret = min(ret, cur);
    }
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &q);
  scanf("%s", str);
  for (int i = 0; i < 30; i++) nas[i] = (1 << 20);
  for (int i = n - 1; i >= 0; i--) {
    nas[str[i] - 'a'] = i;
    for (int j = 0; j < 30; j++) nxt[i][j] = nas[j];
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0][0] = 0;
  while (q--) {
    char s[2], c[2];
    int x;
    scanf("%s %d", s, &x);
    x--;
    if (s[0] == '+') {
      scanf("%s", c);
      v[x].push_back(c[0] - 'a');
    }
    if (s[0] == '-') {
      int k = v[x].size();
      for (int i = 0; i < 300; i++) {
        for (int j = 0; j < 300; j++) {
          if (x == 0) dp[k][i][j] = -1;
          if (x == 1) dp[i][k][j] = -1;
          if (x == 2) dp[i][j][k] = -1;
        }
      }
      v[x].pop_back();
    }
    int ans = fun(v[0].size(), v[1].size(), v[2].size());
    if (ans <= n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
