#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
static int dp[251][251][251];
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int N, Q;
  string W;
  cin >> N >> Q >> W;
  array<vector<int>, 26> pos;
  for (int i = 0; i < N; i++) pos[W[i] - 'a'].push_back(i);
  for (int i = 0; i < 26; i++) pos[i].push_back(N);
  auto nextc = [&](int p, char c) {
    if (p >= N) return N + 1;
    return *lower_bound(begin(pos[c - 'a']), end(pos[c - 'a']), p) + 1;
  };
  array<string, 3> b;
  dp[0][0][0] = 0;
  for (int q = 0; q < Q; q++) {
    char t;
    int r;
    char c;
    cin >> t >> r;
    r--;
    if (t == '+') {
      cin >> c;
      b[r] += c;
      array<int, 3> low, high;
      for (int i = 0; i < 3; i++) {
        low[i] = 0;
        high[i] = ((long long)(b[i]).size());
      }
      low[r] = ((long long)(b[r]).size());
      for (int i = low[0]; i <= high[0]; i++)
        for (int j = low[1]; j <= high[1]; j++)
          for (int k = low[2]; k <= high[2]; k++) {
            int v = N + 1;
            if (i > 0) v = min(v, nextc(dp[i - 1][j][k], b[0][i - 1]));
            if (j > 0) v = min(v, nextc(dp[i][j - 1][k], b[1][j - 1]));
            if (k > 0) v = min(v, nextc(dp[i][j][k - 1], b[2][k - 1]));
            dp[i][j][k] = v;
          }
    } else
      b[r].pop_back();
    cout << (dp[((long long)(b[0]).size())][((long long)(b[1]).size())]
               [((long long)(b[2]).size())] <= N
                 ? "YES\n"
                 : "NO\n");
  }
  return 0;
}
