#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int pre[100009][26], sz[3];
char s[100009];
const int N = 251;
int dp[N][N][N], n, q;
int adj[3][N], t[3];
void solve(int x) {
  for (int i = 0; i < 3; i++) t[i] = 0;
  t[x] = sz[x];
  for (int i = t[0]; i <= sz[0]; i++)
    for (int j = t[1]; j <= sz[1]; j++)
      for (int k = t[2]; k <= sz[2]; k++) {
        if (i + j + k != 0) dp[i][j][k] = n + 1;
        if (i) umin(dp[i][j][k], pre[dp[i - 1][j][k] + 1][adj[0][i]]);
        if (j) umin(dp[i][j][k], pre[dp[i][j - 1][k] + 1][adj[1][j]]);
        if (k) umin(dp[i][j][k], pre[dp[i][j][k - 1] + 1][adj[2][k]]);
      }
}
int main() {
  scanf("%d%d", &n, &q);
  scanf("%s", s + 1);
  for (int i = 0; i < 26; i++) pre[n + 1][i] = pre[n + 2][i] = 1000000007;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < 26; j++) pre[i][j] = pre[i + 1][j];
    pre[i][s[i] - 'a'] = i;
  }
  for (int i = 0; i < 3; i++) adj[i][0] = -1;
  while (q--) {
    char x, y;
    int t;
    scanf(" %c%d", &x, &t);
    if (x == '+') {
      scanf(" %c", &y);
      adj[t - 1][++sz[t - 1]] = y - 'a';
      solve(t - 1);
    } else
      sz[t - 1]--;
    if (dp[sz[0]][sz[1]][sz[2]] <= n)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
