#include <bits/stdc++.h>
using namespace std;
const int MaxN(100003);
string S1, S2, S3;
int F[253][253][253], n, q;
char s[MaxN], op[3], cr[3];
int to[MaxN][26];
int check(int i, int d, int j) {
  if (d == 1) return to[i][S1[j] - 'a'] ? to[i][S1[j] - 'a'] : n + 1;
  if (d == 2) return to[i][S2[j] - 'a'] ? to[i][S2[j] - 'a'] : n + 1;
  if (d == 3) return to[i][S3[j] - 'a'] ? to[i][S3[j] - 'a'] : n + 1;
}
int main() {
  scanf("%d%d%s", &n, &q, s + 1);
  for (int i = n; i; i--) {
    for (int j = 0; j < 26; j++) to[i][j] = to[i + 1][j];
    to[i][s[i] - 'a'] = i;
  }
  F[0][0][0] = 1;
  for (int x; q--;) {
    scanf("%s%d", op, &x);
    if (*op == '+') {
      scanf("%s", cr);
      if (x == 1) {
        S1.push_back(*cr);
        int k = S1.size() - 1;
        for (int i = 0; i <= S2.size(); i++)
          for (int j = 0; j <= S3.size(); j++) {
            if (!F[k][i][j]) continue;
            int t = check(F[k][i][j], 1, k);
            if (t > n)
              F[k + 1][i][j] = 0;
            else
              F[k + 1][i][j] = t + 1;
          }
        ++k;
        for (int i = 0; i <= S2.size(); i++)
          for (int j = 0; j <= S3.size(); j++) {
            if (!F[k][i][j]) continue;
            if (i < S2.size()) {
              int t = check(F[k][i][j], 2, i);
              if (t <= n && (F[k][i + 1][j] == 0 || F[k][i + 1][j] > t))
                F[k][i + 1][j] = t + 1;
            }
            if (j < S3.size()) {
              int t = check(F[k][i][j], 3, j);
              if (t <= n && (F[k][i][j + 1] == 0 || F[k][i][j + 1] > t))
                F[k][i][j + 1] = t + 1;
            }
          }
      }
      if (x == 2) {
        S2.push_back(*cr);
        int k = S2.size() - 1;
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S3.size(); j++) {
            if (!F[i][k][j]) continue;
            int t = check(F[i][k][j], 2, k);
            if (t > n)
              F[i][k + 1][j] = 0;
            else
              F[i][k + 1][j] = t + 1;
          }
        ++k;
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S3.size(); j++) {
            if (!F[i][k][j]) continue;
            if (i < S1.size()) {
              int t = check(F[i][k][j], 1, i);
              if (t <= n && (F[i + 1][k][j] == 0 || F[i + 1][k][j] > t))
                F[i + 1][k][j] = t + 1;
            }
            if (j < S3.size()) {
              int t = check(F[i][k][j], 3, j);
              if (t <= n && (F[i][k][j + 1] == 0 || F[i][k][j + 1] > t))
                F[i][k][j + 1] = t + 1;
            }
          }
      }
      if (x == 3) {
        S3.push_back(*cr);
        int k = S3.size() - 1;
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S2.size(); j++) {
            if (!F[i][j][k]) continue;
            int t = check(F[i][j][k], 3, k);
            if (t > n)
              F[i][j][k + 1] = 0;
            else
              F[i][j][k + 1] = t + 1;
          }
        ++k;
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S2.size(); j++) {
            if (!F[i][j][k]) continue;
            if (i < S1.size()) {
              int t = check(F[i][j][k], 1, i);
              if (t <= n && (F[i + 1][j][k] == 0 || F[i + 1][j][k] > t))
                F[i + 1][j][k] = t + 1;
            }
            if (j < S2.size()) {
              int t = check(F[i][j][k], 2, j);
              if (t <= n && (F[i][j + 1][k] == 0 || F[i][j + 1][k] > t))
                F[i][j + 1][k] = t + 1;
            }
          }
      }
    } else {
      if (x == 1) {
        int k = S1.size();
        for (int i = 0; i <= S2.size(); i++)
          for (int j = 0; j <= S3.size(); j++) F[k][i][j] = 0;
        S1.pop_back();
      }
      if (x == 2) {
        int k = S2.size();
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S3.size(); j++) F[i][k][j] = 0;
        S2.pop_back();
      }
      if (x == 3) {
        int k = S3.size();
        for (int i = 0; i <= S1.size(); i++)
          for (int j = 0; j <= S2.size(); j++) F[i][j][k] = 0;
        S3.pop_back();
      }
    }
    puts(F[S1.size()][S2.size()][S3.size()] ? "YES" : "NO");
  }
  return 0;
}
