#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void setmin(T& a, T b) {
  if (a > b) a = b;
}
int n;
string s;
int nxt[100100][26];
int ans[251][251][251];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int q;
  cin >> n >> q;
  cin >> s;
  const int msz = 250;
  char arr[3][msz];
  memset(arr, 0, sizeof arr);
  for (int i = 0; i <= msz; i++) {
    for (int j = 0; j <= msz; j++) {
      for (int k = 0; k <= msz; k++) {
        ans[i][j][k] = n;
      }
    }
  }
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = n;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = nxt[i + 1][j];
    }
    nxt[i][s[i] - 'a'] = i;
  }
  int sz1 = 0;
  int sz2 = 0;
  int sz3 = 0;
  ans[0][0][0] = -1;
  vector<int> sz(3, 0);
  while (q--) {
    char t;
    cin >> t;
    int ind;
    cin >> ind;
    ind--;
    if (t == '-') {
      sz[ind]--;
    } else {
      vector<int> l = {0, 0, 0};
      sz[ind]++;
      l[ind] = sz[ind];
      char c;
      cin >> c;
      c -= 'a';
      arr[ind][sz[ind]] = c;
      for (int i = l[0]; i <= sz[0]; i++) {
        for (int j = l[1]; j <= sz[1]; j++) {
          for (int k = l[2]; k <= sz[2]; k++) {
            ans[i][j][k] = n;
            if (i) setmin(ans[i][j][k], nxt[ans[i - 1][j][k] + 1][arr[0][i]]);
            if (j) setmin(ans[i][j][k], nxt[ans[i][j - 1][k] + 1][arr[1][j]]);
            if (k) setmin(ans[i][j][k], nxt[ans[i][j][k - 1] + 1][arr[2][k]]);
          }
        }
      }
    }
    cout << (ans[sz[0]][sz[1]][sz[2]] < n ? "YES\n" : "NO\n");
  }
  return 0;
}
