#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, mod = 1e9 + 7, INF = 0x3f3f3f3f;
char s[maxn], op[5], t[5];
int ne[maxn][30], f[300][300][300];
string a[5];
void init(int n) {
  for (int i = 0; i < 26; ++i) ne[n + 1][i] = ne[n][i] = n + 1;
  for (int i = n - 1; i >= 0; --i) {
    for (int j = 0; j < 26; ++j) ne[i][j] = ne[i + 1][j];
    ne[i][s[i + 1] - 'a'] = i + 1;
  }
}
inline void upd(int i, int j, int k) {
  f[i][j][k] = INF;
  if (i) f[i][j][k] = min(f[i][j][k], ne[f[i - 1][j][k]][a[1][i - 1] - 'a']);
  if (j) f[i][j][k] = min(f[i][j][k], ne[f[i][j - 1][k]][a[2][j - 1] - 'a']);
  if (k) f[i][j][k] = min(f[i][j][k], ne[f[i][j][k - 1]][a[3][k - 1] - 'a']);
}
int main() {
  int n, q;
  cin >> n >> q;
  scanf("%s", s + 1);
  init(n);
  while (q--) {
    int id;
    scanf("%s%d", t, &id);
    if (t[0] == '+') {
      scanf("%s", t);
      a[id].push_back(t[0]);
      if (id == 1) {
        for (int i = 0; i <= int(a[2].size()); ++i)
          for (int j = 0; j <= int(a[3].size()); ++j)
            upd(int(a[id].size()), i, j);
      } else if (id == 2) {
        for (int i = 0; i <= int(a[1].size()); ++i)
          for (int j = 0; j <= int(a[3].size()); ++j)
            upd(i, int(a[id].size()), j);
      } else {
        for (int i = 0; i <= int(a[1].size()); ++i)
          for (int j = 0; j <= int(a[2].size()); ++j)
            upd(i, j, int(a[id].size()));
      }
    } else
      a[id].pop_back();
    if (f[int(a[1].size())][int(a[2].size())][int(a[3].size())] <= n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
