#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool smin(T &a, const T &b) {
  return a > b ? a = b : a;
}
template <typename T>
inline bool smax(T &a, const T &b) {
  return a < b ? a = b : a;
}
const int N = (int)1e5 + 5, mod = (int)0;
int best[255][255][255], nxt[N][26];
int a[3][N], sz[3];
int main() {
  ios_base::sync_with_stdio(0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  for (int j = 0; j < 26; ++j) nxt[n][j] = nxt[n + 1][j] = n + 1;
  for (int j = n - 1; j >= 0; --j) {
    for (int c = 0; c < 26; ++c) {
      if (s[j] - 'a' == c) {
        nxt[j][c] = j;
      } else {
        nxt[j][c] = nxt[j + 1][c];
      }
    }
  }
  for (int i = 0; i < 255; ++i)
    for (int j = 0; j < 255; ++j)
      for (int k = 0; k < 255; ++k) best[i][j][k] = n + 1;
  best[0][0][0] = 0;
  while (q--) {
    char ch;
    cin >> ch;
    int rel;
    cin >> rel;
    --rel;
    if (ch == '+') {
      cin >> ch;
      a[rel][sz[rel]++] = ch - 'a';
      int stx = 0, edx = sz[0];
      int sty = 0, edy = sz[1];
      int stz = 0, edz = sz[2];
      if (rel == 0) {
        stx = sz[rel];
        edx = sz[rel];
      } else if (rel == 1) {
        edy = sz[rel];
        sty = sz[rel];
      } else {
        edz = sz[rel];
        stz = sz[rel];
      }
      for (int first = stx; first <= edx; ++first)
        for (int second = sty; second <= edy; ++second)
          for (int z = stz; z <= edz; ++z) {
            best[first][second][z] = n + 1;
            if (first > 0) {
              int pos = best[first - 1][second][z];
              int c = a[0][first - 1];
              int go = nxt[pos][c] + 1;
              go = min(go, n + 1);
              best[first][second][z] = min(best[first][second][z], go);
            }
            if (second > 0) {
              int pos = best[first][second - 1][z];
              int c = a[1][second - 1];
              int go = nxt[pos][c] + 1;
              go = min(go, n + 1);
              best[first][second][z] = min(best[first][second][z], go);
            }
            if (z > 0) {
              int pos = best[first][second][z - 1];
              int c = a[2][z - 1];
              int go = nxt[pos][c] + 1;
              go = min(go, n + 1);
              best[first][second][z] = min(best[first][second][z], go);
            }
          }
    } else {
      --sz[rel];
    }
    cout << (best[sz[0]][sz[1]][sz[2]] <= n ? "YES\n" : "NO\n");
  }
}
