#include <bits/stdc++.h>
using namespace ::std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
int64_t ri64() {
  int64_t x;
  scanf("%lld", &x);
  return x;
}
void wi(int x) { printf("%d\n", x); }
void wvi(vector<int> &v) {
  for (int i = 0; i < v.size(); i++) printf("%d ", v[i]);
  printf("\n");
}
void dbg(string &str, int x) {
  cout << str << ": ";
  wi(x);
}
void dbg(string &str, vector<int> &x) {
  cout << str << ": ";
  wvi(x);
}
int R[251][251][251];
int main() {
  int n = ri();
  int q = ri();
  string str;
  cin >> str;
  vector<vector<int> > P(n + 1, vector<int>(26, -1));
  vector<int> lst(26, -1);
  for (int i = n - 1; i >= 0; i--) {
    int x = str[i] - 'a';
    lst[x] = i;
    for (int j = 0; j < 26; j++) P[i][j] = lst[j];
  }
  vector<vector<int> > A(3);
  R[0][0][0] = 0;
  for (int cnt = 0; cnt < q; cnt++) {
    string x;
    cin >> x;
    int type;
    cin >> type;
    type--;
    if (x[0] == '+') {
      string y;
      cin >> y;
      int c = y[0] - 'a';
      A[type].push_back(c);
      int m = A[type].size();
      if (type == 0) {
        for (int i = 0; i <= A[1].size(); i++) {
          for (int j = 0; j <= A[2].size(); j++) {
            int ans = -1;
            if (R[m - 1][i][j] != -1 && P[R[m - 1][i][j]][c] != -1)
              ans = 1 + P[R[m - 1][i][j]][c];
            if (i > 0 && (R[m][i - 1][j] != -1)) {
              int t = P[R[m][i - 1][j]][A[1][i - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            if (j > 0 && (R[m][i][j - 1] != -1)) {
              int t = P[R[m][i][j - 1]][A[2][j - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            R[m][i][j] = ans;
          }
        }
      }
      if (type == 1) {
        for (int i = 0; i <= A[0].size(); i++) {
          for (int j = 0; j <= A[2].size(); j++) {
            int ans = -1;
            if (R[i][m - 1][j] != -1 && P[R[i][m - 1][j]][c] != -1)
              ans = 1 + P[R[i][m - 1][j]][c];
            if (i > 0 && (R[i - 1][m][j] != -1)) {
              int t = P[R[i - 1][m][j]][A[0][i - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            if (j > 0 && (R[i][m][j - 1] != -1)) {
              int t = P[R[i][m][j - 1]][A[2][j - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            R[i][m][j] = ans;
          }
        }
      }
      if (type == 2) {
        for (int i = 0; i <= A[0].size(); i++) {
          for (int j = 0; j <= A[1].size(); j++) {
            int ans = -1;
            if (R[i][j][m - 1] != -1 && P[R[i][j][m - 1]][c] != -1)
              ans = 1 + P[R[i][j][m - 1]][c];
            if (i > 0 && (R[i - 1][j][m] != -1)) {
              int t = P[R[i - 1][j][m]][A[0][i - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            if (j > 0 && (R[i][j - 1][m] != -1)) {
              int t = P[R[i][j - 1][m]][A[1][j - 1]];
              if (t != -1) {
                if (ans == -1 || ans > (1 + t)) ans = 1 + t;
              }
            }
            R[i][j][m] = ans;
          }
        }
      }
    } else {
      A[type].pop_back();
    }
    if (R[A[0].size()][A[1].size()][A[2].size()] != -1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
