#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 62;
const int mods = 998244353;
const int MAXN = 200005;
const int INF = 0x3f3f3f3f;
inline int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
char st[MAXN];
int num[3], nxt[26];
char s[3][251];
int Nxt[MAXN][26], f[251][251][251];
int main() {
  int n = read(), q = read();
  scanf("%s", st + 1);
  for (int j = 0; j < 26; j++) Nxt[100001][j] = nxt[j] = 100001;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < 26; j++) Nxt[i][j] = nxt[j];
    if (i) nxt[st[i] - 'a'] = i;
  }
  for (int i = 0; i <= 250; i++)
    for (int j = 0; j <= 250; j++)
      for (int k = 0; k <= 250; k++) f[i][j][k] = 100001;
  while (q--) {
    int x;
    char c1[5], c2[5];
    scanf("%s%d", c1, &x), x--;
    f[0][0][0] = 0;
    if (c1[0] == '+') {
      scanf("%s", c2);
      s[x][++num[x]] = c2[0];
      if (x == 0) {
        for (int i = 0; i <= num[1]; i++)
          for (int j = 0; j <= num[2]; j++) {
            upmin(f[num[0]][i][j],
                  Nxt[f[num[0] - 1][i][j]][s[0][num[0]] - 'a']);
            if (i)
              upmin(f[num[0]][i][j], Nxt[f[num[0]][i - 1][j]][s[1][i] - 'a']);
            if (j)
              upmin(f[num[0]][i][j], Nxt[f[num[0]][i][j - 1]][s[2][j] - 'a']);
          }
      }
      if (x == 1) {
        for (int i = 0; i <= num[0]; i++)
          for (int j = 0; j <= num[2]; j++) {
            upmin(f[i][num[1]][j],
                  Nxt[f[i][num[1] - 1][j]][s[1][num[1]] - 'a']);
            if (i)
              upmin(f[i][num[1]][j], Nxt[f[i - 1][num[1]][j]][s[0][i] - 'a']);
            if (j)
              upmin(f[i][num[1]][j], Nxt[f[i][num[1]][j - 1]][s[2][j] - 'a']);
          }
      }
      if (x == 2) {
        for (int i = 0; i <= num[0]; i++)
          for (int j = 0; j <= num[1]; j++) {
            upmin(f[i][j][num[2]],
                  Nxt[f[i][j][num[2] - 1]][s[2][num[2]] - 'a']);
            if (i)
              upmin(f[i][j][num[2]], Nxt[f[i - 1][j][num[2]]][s[0][i] - 'a']);
            if (j)
              upmin(f[i][j][num[2]], Nxt[f[i][j - 1][num[2]]][s[1][j] - 'a']);
          }
      }
    }
    if (c1[0] == '-') {
      if (x == 0)
        for (int i = 0; i <= num[1]; i++)
          for (int j = 0; j <= num[2]; j++) f[num[0]][i][j] = 100001;
      if (x == 1)
        for (int i = 0; i <= num[0]; i++)
          for (int j = 0; j <= num[2]; j++) f[i][num[1]][j] = 100001;
      if (x == 2)
        for (int i = 0; i <= num[0]; i++)
          for (int j = 0; j <= num[1]; j++) f[i][j][num[2]] = 100001;
      num[x]--;
    }
    if (f[num[0]][num[1]][num[2]] == 100001)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
