#include <bits/stdc++.h>
using namespace std;
const int maxn = 100011;
const int maxm = 253;
const int AlphaSize = 26;
char s[maxn];
int d[maxm][maxm][maxm];
int main() {
  int n, q;
  scanf("%d%d%s", &n, &q, s);
  assert(n == strlen(s));
  vector<vector<int>> Next(n + 2, vector<int>(AlphaSize));
  for (int i = 0; i < AlphaSize; ++i) Next[n][i] = Next[n + 1][i] = n;
  for (int i = n - 1; i >= 0; --i)
    for (int j = 0; j < AlphaSize; ++j)
      Next[i][j] = (s[i] - 'a' == j) ? i : Next[i + 1][j];
  vector<vector<char>> ss(3);
  d[0][0][0] = -1;
  while (q--) {
    char op, c;
    int id;
    scanf(" %c%d", &op, &id);
    --id;
    if (op == '+') {
      scanf(" %c", &c);
      ss[id].push_back(c);
      int min0 = (id == 0) ? ss[0].size() : 0, max0 = ss[0].size();
      int min1 = (id == 1) ? ss[1].size() : 0, max1 = ss[1].size();
      int min2 = (id == 2) ? ss[2].size() : 0, max2 = ss[2].size();
      for (int i = min0; i <= max0; ++i) {
        for (int j = min1; j <= max1; ++j) {
          for (int k = min2; k <= max2; ++k) {
            if (i || j || k) d[i][j][k] = n;
            if (i)
              d[i][j][k] =
                  min(d[i][j][k], Next[d[i - 1][j][k] + 1][ss[0][i - 1] - 'a']);
            if (j)
              d[i][j][k] =
                  min(d[i][j][k], Next[d[i][j - 1][k] + 1][ss[1][j - 1] - 'a']);
            if (k)
              d[i][j][k] =
                  min(d[i][j][k], Next[d[i][j][k - 1] + 1][ss[2][k - 1] - 'a']);
          }
        }
      }
    } else {
      ss[id].pop_back();
    }
    puts(d[ss[0].size()][ss[1].size()][ss[2].size()] < n ? "YES" : "NO");
  }
  return 0;
}
