#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[100010];
int nex[100010][30];
int cha[30];
int dp[300][300][300];
int s[4][300], len[4];
bool flag = false;
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < 26; i++) cha[i] = n + 1;
  for (int i = 1; i <= n; i++) {
    char c = getchar();
    while (c < 'a' || c > 'z') c = getchar();
    a[i] = c - 'a';
  }
  for (int i = n + 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      nex[i][j] = cha[j];
    }
    cha[a[i]] = i;
  }
  memset(len, 0, sizeof(len));
  while (q--) {
    char c = getchar();
    while (c != '+' && c != '-') c = getchar();
    int re;
    scanf("%d", &re);
    int num;
    if (c == '+') {
      c = getchar();
      while (c < 'a' || c > 'z') c = getchar();
      num = c - 'a';
      s[re][++len[re]] = num;
      int min1 = re == 1 ? len[1] : 0;
      int min2 = re == 2 ? len[2] : 0;
      int min3 = re == 3 ? len[3] : 0;
      for (int i = min1; i <= len[1]; i++) {
        for (int j = min2; j <= len[2]; j++) {
          for (int k = min3; k <= len[3]; k++) {
            int &val = dp[i][j][k];
            val = n + 1;
            if (i) val = min(val, nex[dp[i - 1][j][k]][s[1][i]]);
            if (j) val = min(val, nex[dp[i][j - 1][k]][s[2][j]]);
            if (k) val = min(val, nex[dp[i][j][k - 1]][s[3][k]]);
          }
        }
      }
    } else {
      --len[re];
    }
    if (dp[len[1]][len[2]][len[3]] <= n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
