#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
inline int readInt() {
  int x;
  scanf("%d", &x);
  return x;
}
int dp[255][255][255];
int nex[26][100005];
char words[3][256];
int cnt[3];
int main() {
  int n, q;
  string s;
  scanf("%d%d", &n, &q);
  cin >> s;
  vector<int> nt(26, n + 1);
  for (int j = 0; j < (int)26; ++j) nex[j][n + 1] = n + 1;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < (int)26; ++j) nex[j][i] = nt[j];
    if (i > 0) nt[s[i - 1] - 'a'] = i;
  }
  for (int i = 0; i < (int)255; ++i)
    for (int j = 0; j < (int)255; ++j)
      for (int k = 0; k < (int)255; ++k) dp[i][j][k] = n + 1;
  dp[0][0][0] = 0;
  for (int i = 0; i < (int)q; ++i) {
    char op[2], ch[2];
    int idx;
    scanf("%s%d", op, &idx);
    idx--;
    if (op[0] == '+') {
      scanf("%s", ch);
      words[idx][cnt[idx]] = ch[0];
      cnt[idx]++;
      for (int i = (idx == 0) ? cnt[0] : 0; i < (int)cnt[0] + 1; ++i) {
        for (int j = (idx == 1) ? cnt[1] : 0; j < (int)cnt[1] + 1; ++j) {
          for (int k = (idx == 2) ? cnt[2] : 0; k < (int)cnt[2] + 1; ++k) {
            if (i > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nex[words[0][i - 1] - 'a'][dp[i - 1][j][k]]);
            if (j > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nex[words[1][j - 1] - 'a'][dp[i][j - 1][k]]);
            if (k > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nex[words[2][k - 1] - 'a'][dp[i][j][k - 1]]);
          }
        }
      }
    } else {
      for (int i = (idx == 0) ? cnt[0] : 0; i < (int)cnt[0] + 1; ++i) {
        for (int j = (idx == 1) ? cnt[1] : 0; j < (int)cnt[1] + 1; ++j) {
          for (int k = (idx == 2) ? cnt[2] : 0; k < (int)cnt[2] + 1; ++k) {
            dp[i][j][k] = n + 1;
          }
        }
      }
      cnt[idx]--;
    }
    if (dp[cnt[0]][cnt[1]][cnt[2]] <= n) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
