#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = 255;
int n, q;
int dp[maxm][maxm][maxm];
int Next[maxn][26];
int type;
char s[maxn];
char op[3], ch[3];
string now[3];
int miin[3], maax[3];
void init(char s[], int n) {
  for (int j = 0; j < 26; ++j) Next[n][j] = Next[n + 1][j] = n;
  for (int i = n - 1; i >= 0; --i) {
    int num = s[i] - 'a';
    for (int j = 0; j < 26; ++j) {
      if (j == num)
        Next[i][j] = i;
      else
        Next[i][j] = Next[i + 1][j];
    }
  }
}
void cal(int i, int j, int k) {
  int &ans = dp[i][j][k];
  ans = n;
  if (i) ans = min(ans, Next[dp[i - 1][j][k] + 1][now[0][i - 1] - 'a']);
  if (j) ans = min(ans, Next[dp[i][j - 1][k] + 1][now[1][j - 1] - 'a']);
  if (k) ans = min(ans, Next[dp[i][j][k - 1] + 1][now[2][k - 1] - 'a']);
}
int main() {
  scanf("%d%d", &n, &q);
  scanf("%s", s);
  init(s, n);
  dp[0][0][0] = -1;
  for (int i = 1; i <= q; ++i) {
    scanf("%s%d", op, &type);
    type--;
    if (op[0] == '+') {
      scanf("%s", ch);
      now[type] += ch[0];
      for (int j = 0; j < 3; ++j) {
        miin[j] = 0;
        maax[j] = now[j].size();
      }
      miin[type] = maax[type];
      for (int a = miin[0]; a <= maax[0]; ++a) {
        for (int b = miin[1]; b <= maax[1]; ++b) {
          for (int c = miin[2]; c <= maax[2]; ++c) {
            cal(a, b, c);
          }
        }
      }
    } else
      now[type].pop_back();
    puts(dp[now[0].size()][now[1].size()][now[2].size()] < n ? "YES" : "NO");
  }
  return 0;
}
