#include <bits/stdc++.h>
using namespace std;
int M;
int dp[255][255][255];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  M = 100005;
  int n, i, j, k, q;
  int sa[] = {0, 0, 0, 0};
  vector<char> ca[4];
  cin >> n >> q;
  string w;
  cin >> w;
  int lca[n + 1][26];
  for (i = 0; i < 26; i++) {
    lca[n][i] = M;
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < 26; j++) {
      if (w[i] == ('a' + j))
        lca[i][j] = i + 1;
      else
        lca[i][j] = lca[i + 1][j];
    }
  }
  dp[0][0][0] = 0;
  for (i = 0; i < q; i++) {
    char a, ch;
    int c;
    cin >> a >> c;
    if (a == '-') {
      ca[c].pop_back();
      sa[c]--;
    } else {
      cin >> ch;
      sa[c]++;
      ca[c].push_back(ch);
      if (c == 1) {
        for (j = 0; j <= sa[2]; j++) {
          for (k = 0; k <= sa[3]; k++) {
            dp[sa[1]][j][k] = M;
            if (dp[sa[1] - 1][j][k] < M)
              dp[sa[1]][j][k] = lca[dp[sa[1] - 1][j][k]][ch - 'a'];
            if (j > 0 && dp[sa[1]][j - 1][k] < M)
              dp[sa[1]][j][k] =
                  min(dp[sa[1]][j][k],
                      lca[dp[sa[1]][j - 1][k]][ca[2][j - 1] - 'a']);
            if (k > 0 && dp[sa[1]][j][k - 1] < M)
              dp[sa[1]][j][k] =
                  min(dp[sa[1]][j][k],
                      lca[dp[sa[1]][j][k - 1]][ca[3][k - 1] - 'a']);
          }
        }
      } else if (c == 2) {
        for (j = 0; j <= sa[1]; j++) {
          for (k = 0; k <= sa[3]; k++) {
            dp[j][sa[2]][k] = M;
            if (dp[j][sa[2] - 1][k] < M)
              dp[j][sa[2]][k] = lca[dp[j][sa[2] - 1][k]][ch - 'a'];
            if (j > 0 && dp[j - 1][sa[2]][k] < M)
              dp[j][sa[2]][k] =
                  min(dp[j][sa[2]][k],
                      lca[dp[j - 1][sa[2]][k]][ca[1][j - 1] - 'a']);
            if (k > 0 && dp[j][sa[2]][k - 1] < M)
              dp[j][sa[2]][k] =
                  min(dp[j][sa[2]][k],
                      lca[dp[j][sa[2]][k - 1]][ca[3][k - 1] - 'a']);
          }
        }
      } else {
        for (j = 0; j <= sa[1]; j++) {
          for (k = 0; k <= sa[2]; k++) {
            dp[j][k][sa[3]] = M;
            if (dp[j][k][sa[3] - 1] < M)
              dp[j][k][sa[3]] = lca[dp[j][k][sa[3] - 1]][ch - 'a'];
            if (j > 0 && dp[j - 1][k][sa[3]] < M)
              dp[j][k][sa[3]] =
                  min(dp[j][k][sa[3]],
                      lca[dp[j - 1][k][sa[3]]][ca[1][j - 1] - 'a']);
            if (k > 0 && dp[j][k - 1][sa[3]] < M)
              dp[j][k][sa[3]] =
                  min(dp[j][k][sa[3]],
                      lca[dp[j][k - 1][sa[3]]][ca[2][k - 1] - 'a']);
          }
        }
      }
    }
    if (dp[sa[1]][sa[2]][sa[3]] < M)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}
