#include <bits/stdc++.h>
using namespace std;
const int N = 260;
int n, q, f[N][N][N], t[3], a[3][N];
string s;
vector<int> sv[N];
int v(int i, int x) {
  int c = upper_bound(sv[i].begin(), sv[i].end(), x) - sv[i].begin();
  if (c == sv[i].size()) return n + 1;
  return sv[i][c];
}
int F(int i, int j, int k) {
  if (!i && !j && !k) return 0;
  if (f[i][j][k] != -1) return f[i][j][k];
  int ret = n + 1;
  if (i) ret = min(ret, v(a[0][i], F(i - 1, j, k)));
  if (j) ret = min(ret, v(a[1][j], F(i, j - 1, k)));
  if (k) ret = min(ret, v(a[2][k], F(i, j, k - 1)));
  return f[i][j][k] = ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(f, -1, sizeof(f));
  cin >> n >> q >> s;
  s = ' ' + s;
  for (int i = 1; i <= n; ++i) sv[s[i] - 'a'].push_back(i);
  while (q--) {
    char o;
    cin >> o;
    if (o == '+') {
      int i;
      char c;
      cin >> i >> c;
      --i;
      a[i][++t[i]] = c - 'a';
    } else {
      int i;
      cin >> i;
      --i;
      for (int j = 0; j <= t[(i + 1) % 3]; ++j)
        for (int k = 0; k <= t[(i + 2) % 3]; ++k) {
          if (!i) f[t[i]][j][k] = -1;
          if (i == 1) f[k][t[i]][j] = -1;
          if (i == 2) f[j][k][t[i]] = -1;
        }
      --t[i];
    }
    if (F(t[0], t[1], t[2]) <= n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
