#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m = 998244353) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long inverse(long long a, long long m = 998244353) {
  return power(a, m - 2, m);
}
int dp[255][255][255];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, Q;
  string str, desc[4];
  cin >> n >> Q;
  cin >> str;
  int nxt[n + 2][26];
  for (int i = 0; i < 26; i++) nxt[n + 1][i] = nxt[n][i] = 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][str[i] - 'a'] = i;
  }
  for (int T = 0; T < Q; T++) {
    char op, ch;
    int type;
    cin >> op;
    cin >> type;
    if (op == '+') {
      cin >> ch;
      desc[type] += ch;
      int p = desc[1].size();
      int q = desc[2].size();
      int r = desc[3].size();
      if (type == 1) {
        for (int i = 0; i < q + 1; i++)
          for (int j = 0; j < r + 1; j++) {
            dp[p][i][j] = 1000000009;
            if (i >= 1)
              dp[p][i][j] = min(dp[p][i][j],
                                nxt[dp[p][i - 1][j]][desc[2][i - 1] - 'a'] + 1);
            if (j >= 1)
              dp[p][i][j] = min(dp[p][i][j],
                                nxt[dp[p][i][j - 1]][desc[3][j - 1] - 'a'] + 1);
            dp[p][i][j] = min(dp[p][i][j],
                              nxt[dp[p - 1][i][j]][desc[1][p - 1] - 'a'] + 1);
          }
      }
      if (type == 2) {
        for (int i = 0; i < p + 1; i++)
          for (int j = 0; j < r + 1; j++) {
            dp[i][q][j] = 1000000009;
            if (i >= 1)
              dp[i][q][j] = min(dp[i][q][j],
                                nxt[dp[i - 1][q][j]][desc[1][i - 1] - 'a'] + 1);
            if (j >= 1)
              dp[i][q][j] = min(dp[i][q][j],
                                nxt[dp[i][q][j - 1]][desc[3][j - 1] - 'a'] + 1);
            dp[i][q][j] = min(dp[i][q][j],
                              nxt[dp[i][q - 1][j]][desc[2][q - 1] - 'a'] + 1);
          }
      }
      if (type == 3) {
        for (int i = 0; i < p + 1; i++)
          for (int j = 0; j < q + 1; j++) {
            dp[i][j][r] = 1000000009;
            if (i >= 1)
              dp[i][j][r] = min(dp[i][j][r],
                                nxt[dp[i - 1][j][r]][desc[1][i - 1] - 'a'] + 1);
            if (j >= 1)
              dp[i][j][r] = min(dp[i][j][r],
                                nxt[dp[i][j - 1][r]][desc[2][j - 1] - 'a'] + 1);
            dp[i][j][r] = min(dp[i][j][r],
                              nxt[dp[i][j][r - 1]][desc[3][r - 1] - 'a'] + 1);
          }
      }
    } else {
      desc[type].pop_back();
    }
    int p = desc[1].size();
    int q = desc[2].size();
    int r = desc[3].size();
    if (dp[p][q][r] <= n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
