#include <bits/stdc++.h>
char str[200000];
long long jmp[200000][26];
long long sc[] = {1, 300, 90000};
long long dp[300][300][300];
char str2[3][300];
int main() {
  char ch;
  long long a, b, c, i, j, k, n, m, q, ans1, ans2, ans3, s[3], iq, t1, t2;
  long long *cur;
  scanf("%lld%lld\n", &n, &m);
  for (i = 1; i <= n; i++) {
  RE:
    scanf("%c", &str[i]);
    if (isalpha(str[i]) == 0) {
      goto RE;
    }
    str[i] = tolower(str[i]) - 'a';
  }
  for (j = 0; j < 26; j++) {
    jmp[n + 1][j] = (long long)0xFFFFFFFF;
  }
  for (i = n; i >= 1; i--) {
    for (j = 0; j < 26; j++) {
      if (str[i] == j) {
        jmp[i][j] = i;
      } else {
        jmp[i][j] = jmp[i + 1][j];
      }
    }
  }
  for (j = 0; j < 26; j++) {
    jmp[0][j] = jmp[1][j];
  }
  s[0] = 0;
  s[1] = 0;
  s[2] = 0;
  dp[0][0][0] = 0;
  for (iq = 1; iq <= m; iq++) {
  RE2:
    scanf("%c", &ch);
    if (ch == '+') {
      scanf("%lld", &a);
      a -= 1;
    RE3:
      scanf("%c", &ch);
      if (isalpha(ch) == 0) {
        goto RE3;
      }
      b = tolower(ch) - 'a';
      s[a] += 1;
      str2[a][s[a]] = b;
      t1 = (a + 1) % 3;
      t2 = (a + 2) % 3;
      for (i = 0; i <= s[t1]; i++) {
        for (j = 0; j <= s[t2]; j++) {
          ans1 = ans2 = ans3 = (long long)0xFFFFFFFF;
          if (i > 0) {
            cur = &dp[0][0][0] + (i - 1) * sc[t1] + j * sc[t2] + s[a] * sc[a];
            if (*cur < ans1) {
              ans1 = jmp[*cur + 1][str2[t1][i]];
            }
          }
          if (j > 0) {
            cur = &dp[0][0][0] + i * sc[t1] + (j - 1) * sc[t2] + s[a] * sc[a];
            if (*cur < ans2) {
              ans2 = jmp[*cur + 1][str2[t2][j]];
            }
          }
          cur = &dp[0][0][0] + i * sc[t1] + j * sc[t2] + (s[a] - 1) * sc[a];
          if (*cur < ans3) {
            ans3 = jmp[*cur + 1][b];
          }
          *(&dp[0][0][0] + i * sc[t1] + j * sc[t2] + s[a] * sc[a]) =
              ((((((ans1) < (ans2)) ? (ans1) : (ans2))) < (ans3))
                   ? ((((ans1) < (ans2)) ? (ans1) : (ans2)))
                   : (ans3));
        }
      }
    } else if (ch == '-') {
      scanf("%lld", &a);
      a -= 1;
      s[a] -= 1;
    } else {
      goto RE2;
    }
    if (dp[s[2]][s[1]][s[0]] <= n) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
