#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MAXL = 255;
const int INF = (long long)1e9 + 5;
const long long MOD = 998244353;
int N, Q, nxt[MAXN][128], dp[MAXL][MAXL][MAXL];
string s, q[5];
vector<int> occ[128];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> Q >> s;
  for (int i = 0; i < s.size(); i++) {
    occ[s[i]].push_back(i);
  }
  for (int t = 0; t < 128; t++) {
    int ptr2 = 0;
    for (int i = 0; i <= s.size(); i++) {
      nxt[i][t] = INF;
      while (ptr2 < occ[t].size() && occ[t][ptr2] < i) ptr2++;
      if (ptr2 < occ[t].size()) {
        nxt[i][t] = occ[t][ptr2];
      }
    }
  }
  for (int i = 0; i < Q; i++) {
    char t, add;
    int id;
    cin >> t >> id;
    if (t == '+') {
      cin >> add;
      q[id].push_back(add);
      if (id == 1) {
        for (int i = 0; i <= q[2].size(); i++) {
          for (int j = 0; j <= q[3].size(); j++) {
            int best = INF, k = q[id].size(), ch = q[id].back();
            if (k > 0 && dp[k - 1][i][j] <= N)
              best = min(best, nxt[dp[k - 1][i][j]][q[1][k - 1]] + 1);
            if (i > 0 && dp[k][i - 1][j] <= N)
              best = min(best, nxt[dp[k][i - 1][j]][q[2][i - 1]] + 1);
            if (j > 0 && dp[k][i][j - 1] <= N)
              best = min(best, nxt[dp[k][i][j - 1]][q[3][j - 1]] + 1);
            dp[k][i][j] = best;
          }
        }
      } else if (id == 2) {
        for (int i = 0; i <= q[1].size(); i++) {
          for (int j = 0; j <= q[3].size(); j++) {
            int best = INF, k = q[id].size(), ch = q[id].back();
            if (i > 0 && dp[i - 1][k][j] <= N)
              best = min(best, nxt[dp[i - 1][k][j]][q[1][i - 1]] + 1);
            if (k > 0 && dp[i][k - 1][j] <= N)
              best = min(best, nxt[dp[i][k - 1][j]][q[2][k - 1]] + 1);
            if (j > 0 && dp[i][k][j - 1] <= N)
              best = min(best, nxt[dp[i][k][j - 1]][q[3][j - 1]] + 1);
            dp[i][k][j] = best;
          }
        }
      } else {
        for (int i = 0; i <= q[1].size(); i++) {
          for (int j = 0; j <= q[2].size(); j++) {
            int best = INF, k = q[id].size();
            if (i > 0 && dp[i - 1][j][k] <= N)
              best = min(best, nxt[dp[i - 1][j][k]][q[1][i - 1]] + 1);
            if (j > 0 && dp[i][j - 1][k] <= N)
              best = min(best, nxt[dp[i][j - 1][k]][q[2][j - 1]] + 1);
            if (k > 0 && dp[i][j][k - 1] <= N)
              best = min(best, nxt[dp[i][j][k - 1]][q[3][k - 1]] + 1);
            dp[i][j][k] = best;
          }
        }
      }
    } else {
      if (!q[id].empty()) {
        q[id].pop_back();
      }
    }
    if (dp[q[1].size()][q[2].size()][q[3].size()] <= N) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
