#include <bits/stdc++.h>
using namespace std;
constexpr int MAX_N = 100100;
constexpr int MAX_LEN = 255;
constexpr int ALPHA = 26;
int n, m;
char s[MAX_N];
int nxt[MAX_N][ALPHA];
int last[ALPHA];
int dp[MAX_LEN][MAX_LEN][MAX_LEN];
vector<int> words[3];
int combine(int x, int y) {
  if (x == -1) return y;
  if (y == -1) return x;
  return min(x, y);
}
int get_nxt(int i, int j) {
  if (i == -1) return -1;
  return nxt[i][j];
}
void update(int a, int b, int c) {
  int best = -1;
  if (a > 0) best = combine(best, get_nxt(dp[a - 1][b][c], words[0][a - 1]));
  if (b > 0) best = combine(best, get_nxt(dp[a][b - 1][c], words[1][b - 1]));
  if (c > 0) best = combine(best, get_nxt(dp[a][b][c - 1], words[2][c - 1]));
  dp[a][b][c] = best;
}
int main() {
  scanf(" %d %d", &n, &m);
  scanf(" %s", s + 1);
  for (int i = 1; i <= n; ++i) s[i] -= 'a';
  memset(nxt, -1, sizeof(nxt));
  memset(last, -1, sizeof(last));
  for (int i = n; i >= 0; --i) {
    for (int c = 0; c < ALPHA; ++c) {
      nxt[i][c] = last[c];
    }
    last[s[i]] = i;
  }
  dp[0][0][0] = 0;
  for (int i = 0; i < m; ++i) {
    char typ;
    int idx;
    scanf(" %c %d", &typ, &idx);
    --idx;
    if (typ == '+') {
      char let;
      scanf(" %c", &let);
      words[idx].push_back(let - 'a');
      if (idx == 0) {
        for (int b = 0; b <= words[1].size(); ++b) {
          for (int c = 0; c <= words[2].size(); ++c) {
            dp[words[0].size()][b][c] = -1;
          }
        }
        for (int b = 0; b <= words[1].size(); ++b) {
          for (int c = 0; c <= words[2].size(); ++c) {
            update(words[0].size(), b, c);
          }
        }
      } else if (idx == 1) {
        for (int a = 0; a <= words[0].size(); ++a) {
          for (int c = 0; c <= words[2].size(); ++c) {
            dp[a][words[1].size()][c] = -1;
          }
        }
        for (int a = 0; a <= words[0].size(); ++a) {
          for (int c = 0; c <= words[2].size(); ++c) {
            update(a, words[1].size(), c);
          }
        }
      } else if (idx == 2) {
        for (int a = 0; a <= words[0].size(); ++a) {
          for (int b = 0; b <= words[1].size(); ++b) {
            dp[a][b][words[2].size()] = -1;
          }
        }
        for (int a = 0; a <= words[0].size(); ++a) {
          for (int b = 0; b <= words[1].size(); ++b) {
            update(a, b, words[2].size());
          }
        }
      }
    } else if (typ == '-') {
      words[idx].pop_back();
    } else {
      assert(false);
    }
    printf(
        "%s\n",
        dp[(int)words[0].size()][(int)words[1].size()][(int)words[2].size()] ==
                -1
            ? "NO"
            : "YES");
  }
  return 0;
}
