#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
int n, q, dp[255][255][255];
char s[100015], t[4][255];
int num[3];
vector<int> v[27];
int main() {
  scanf("%d%d %s", &n, &q, s + 1);
  for (int i = 1; i <= n; ++i) {
    v[s[i] - 'a'].push_back(i);
  }
  memset(dp, INF, sizeof(dp));
  dp[0][0][0] = 0;
  for (int i = 1; i <= q; ++i) {
    char op, c;
    int k;
    scanf(" %c", &op);
    if ('+' == op) {
      scanf("%d %c", &k, &c);
      t[k][++num[k]] = c;
      if (1 == k) {
        for (int j = 0; j <= num[2]; ++j) {
          for (int l = 0; l <= num[3]; ++l) {
            dp[num[k]][j][l] = INF;
            int id = t[k][num[k]] - 'a';
            int sta = dp[num[k] - 1][j][l];
            vector<int>::iterator it =
                upper_bound(v[id].begin(), v[id].end(), sta);
            if (it != v[id].end()) {
              dp[num[k]][j][l] = min(dp[num[k]][j][l], *it);
            }
            if (j) {
              id = t[2][j] - 'a';
              sta = dp[num[k]][j - 1][l];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[num[k]][j][l] = min(dp[num[k]][j][l], *it);
              }
            }
            if (l) {
              id = t[3][l] - 'a';
              sta = dp[num[k]][j][l - 1];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[num[k]][j][l] = min(dp[num[k]][j][l], *it);
              }
            }
          }
        }
      } else if (2 == k) {
        for (int i = 0; i <= num[1]; ++i) {
          for (int l = 0; l <= num[3]; ++l) {
            dp[i][num[k]][l] = INF;
            int id = t[k][num[k]] - 'a';
            int sta = dp[i][num[k] - 1][l];
            vector<int>::iterator it =
                upper_bound(v[id].begin(), v[id].end(), sta);
            if (it != v[id].end()) {
              dp[i][num[k]][l] = min(dp[i][num[k]][l], *it);
            }
            if (i) {
              id = t[1][i] - 'a';
              sta = dp[i - 1][num[k]][l];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[i][num[k]][l] = min(dp[i][num[k]][l], *it);
              }
            }
            if (l) {
              id = t[3][l] - 'a';
              sta = dp[i][num[k]][l - 1];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[i][num[k]][l] = min(dp[i][num[k]][l], *it);
              }
            }
          }
        }
      } else {
        for (int i = 0; i <= num[1]; ++i) {
          for (int j = 0; j <= num[2]; ++j) {
            dp[i][j][num[k]] = INF;
            int id = t[k][num[k]] - 'a';
            int sta = dp[i][j][num[k] - 1];
            vector<int>::iterator it =
                upper_bound(v[id].begin(), v[id].end(), sta);
            if (it != v[id].end()) {
              dp[i][j][num[k]] = min(dp[i][j][num[k]], *it);
            }
            if (i) {
              id = t[1][i] - 'a';
              sta = dp[i - 1][j][num[k]];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[i][j][num[k]] = min(dp[i][j][num[k]], *it);
              }
            }
            if (j) {
              id = t[2][j] - 'a';
              sta = dp[i][j - 1][num[k]];
              it = upper_bound(v[id].begin(), v[id].end(), sta);
              if (it != v[id].end()) {
                dp[i][j][num[k]] = min(dp[i][j][num[k]], *it);
              }
            }
          }
        }
      }
    } else {
      scanf("%d", &k);
      --num[k];
    }
    puts(dp[num[1]][num[2]][num[3]] <= n ? "YES" : "NO");
  }
  return 0;
}
