#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline bool chkmax(T& a, U b) {
  return (a < b) ? (a = b, true) : false;
}
template <class T, class U>
inline bool chkmin(T& a, U b) {
  return (a > b) ? (a = b, true) : false;
}
template <class T>
inline vector<T> uniq(vector<T> vec) {
  sort((vec).begin(), (vec).end()),
      vec.erase(unique((vec).begin(), (vec).end()), end(vec));
  return vec;
}
void solve();
int main(int argc, char** argv) {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout.setf(ios_base::fixed), cout.precision(10);
  solve();
  double times = (clock() * 1.0 / CLOCKS_PER_SEC);
  do {
  } while (0);
}
char s[101010], t[4][303];
int len[4], go[101010][30], dp[252][252][252];
void solve() {
  int n, q;
  cin >> n >> q;
  cin >> (s + 1);
  for (int i = 0; i < 26; i++) {
    go[n + 1][i] = go[n][i] = n + 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) go[i][j] = go[i + 1][j];
    go[i][s[i + 1] - 'a'] = i + 1;
  }
  while (q--) {
    char opt;
    cin >> opt;
    if (opt == '-') {
      int i;
      cin >> i, --len[i];
    } else {
      int p;
      cin >> p;
      char c;
      cin >> c;
      t[p][++len[p]] = c;
      for (int i = p == 1 ? len[1] : 0; i <= len[1]; i++) {
        for (int j = p == 2 ? len[2] : 0; j <= len[2]; j++) {
          for (int k = p == 3 ? len[3] : 0; k <= len[3]; k++) {
            dp[i][j][k] = n + 1;
          }
        }
      }
      dp[0][0][0] = 0;
      for (int i = p == 1 ? len[1] : 0; i <= len[1]; i++) {
        for (int j = p == 2 ? len[2] : 0; j <= len[2]; j++) {
          for (int k = p == 3 ? len[3] : 0; k <= len[3]; k++) {
            if (i - 1 >= 0)
              chkmin(dp[i][j][k], go[dp[i - 1][j][k]][t[1][i] - 'a']);
            if (j - 1 >= 0)
              chkmin(dp[i][j][k], go[dp[i][j - 1][k]][t[2][j] - 'a']);
            if (k - 1 >= 0)
              chkmin(dp[i][j][k], go[dp[i][j][k - 1]][t[3][k] - 'a']);
          }
        }
      }
    }
    cout << (dp[len[1]][len[2]][len[3]] <= n ? "YES" : "NO") << "\n";
  }
}
