#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 100005;
int n, q;
char s[N];
vector<char> need[5];
int sz[5];
vector<int> pos[30];
int dp[255][255][255];
int f(int at[]) {
  if (at[1] == 0 && at[2] == 0 && at[3] == 0) return 0;
  int &ans = dp[at[1]][at[2]][at[3]];
  if (ans != -1) return ans;
  ans = n + 1;
  for (int i = 1; i <= 3; i++) {
    if (at[i]) {
      at[i]--;
      auto it = lower_bound(pos[need[i][at[i]] - 'a'].begin(),
                            pos[need[i][at[i]] - 'a'].end(), f(at));
      if (it != pos[need[i][at[i]] - 'a'].end()) {
        ans = min(ans, *it + 1);
      }
      at[i]++;
    }
  }
  return ans;
}
int main() {
  scanf("%d %d", &n, &q);
  scanf("%s", s);
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) {
    pos[s[i] - 'a'].push_back(i);
  }
  while (q--) {
    char op;
    scanf(" %c", &op);
    if (op == '+') {
      int id;
      char c;
      scanf("%d %c", &id, &c);
      sz[id]++;
      need[id].push_back(c);
    } else {
      int id;
      scanf("%d", &id);
      need[id].pop_back();
      if (id == 1) {
        for (int i = 0; i <= sz[2]; i++) {
          for (int j = 0; j <= sz[3]; j++) {
            dp[sz[1]][i][j] = -1;
          }
        }
      }
      if (id == 2) {
        for (int i = 0; i <= sz[1]; i++) {
          for (int j = 0; j <= sz[3]; j++) {
            dp[i][sz[2]][j] = -1;
          }
        }
      }
      if (id == 3) {
        for (int i = 0; i <= sz[2]; i++) {
          for (int j = 0; j <= sz[1]; j++) {
            dp[j][i][sz[3]] = -1;
          }
        }
      }
      sz[id]--;
    }
    if (f(sz) <= n) {
      printf("YES\n");
    } else
      printf("NO\n");
  }
  return 0;
}
