#include <bits/stdc++.h>
using namespace std;
int N, Q;
char S[100004];
string R[3];
vector<int> pos[27];
const int INF = 1000000;
int DP[252][252][252];
int go(int i, int j, int k) {
  if (i == 0 && j == 0 && k == 0) return 0;
  int& res = DP[i][j][k];
  if (res < 0) {
    res = INF;
    if (i > 0) {
      int p = go(i - 1, j, k);
      int idx = R[0][i] - 'a';
      auto it = upper_bound(pos[idx].begin(), pos[idx].end(), p);
      if (it != pos[idx].end()) {
        res = min(res, *it);
      }
    }
    if (j > 0) {
      int p = go(i, j - 1, k);
      int idx = R[1][j] - 'a';
      auto it = upper_bound(pos[idx].begin(), pos[idx].end(), p);
      if (it != pos[idx].end()) {
        res = min(res, *it);
      }
    }
    if (k > 0) {
      int p = go(i, j, k - 1);
      int idx = R[2][k] - 'a';
      auto it = upper_bound(pos[idx].begin(), pos[idx].end(), p);
      if (it != pos[idx].end()) {
        res = min(res, *it);
      }
    }
  }
  return res;
}
void precompute() {
  for (int n = (1), _b = (N); n <= _b; ++n) {
    int idx = S[n] - 'a';
    pos[idx].push_back(n);
  }
  for (int j = 0, _n = (3); j < _n; ++j) R[j] += 'z' + 1;
  memset(DP, -1, sizeof(DP));
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> N >> Q;
  cin >> (S + 1);
  precompute();
  for (int q = (1), _b = (Q); q <= _b; ++q) {
    int religion_id;
    string op;
    cin >> op >> religion_id;
    --religion_id;
    if (op == "+") {
      string ch;
      cin >> ch;
      R[religion_id] += ch;
      int len = int((R[religion_id]).size()) - 1;
      switch (religion_id) {
        case 0:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[len][ii][jj] = -1;
          break;
        case 1:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[ii][len][jj] = -1;
          break;
        case 2:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[ii][jj][len] = -1;
          break;
      }
    } else {
      int len = int((R[religion_id]).size()) - 1;
      R[religion_id].erase(len);
      switch (religion_id) {
        case 0:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[len][ii][jj] = -1;
          break;
        case 1:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[ii][len][jj] = -1;
          break;
        case 2:
          for (int ii = (0), _b = (250); ii <= _b; ++ii)
            for (int jj = (0), _b = (250); jj <= _b; ++jj) DP[ii][jj][len] = -1;
          break;
      }
    }
    int res = go(int((R[0]).size()) - 1, int((R[1]).size()) - 1,
                 int((R[2]).size()) - 1);
    cout << (res < INF ? "YES" : "NO") << '\n';
  }
  return 0;
}
