#include <bits/stdc++.h>
using namespace std;
char s[100015];
long long g[100015][33], f[255][255][255], len[10];
char a[10][300];
long long n, q;
void qmin(long long &x, long long y) {
  if (y < x) x = y;
}
signed main() {
  cin >> n >> q;
  scanf("%s", s + 1);
  for (long long i = 0; i < 26; i++) {
    g[n + 1][i] = 0x3f3f3f3f;
    for (long long j = n; j >= 0; j--) {
      g[j][i] = g[j + 1][i];
      if (s[j] == 'a' + i) g[j][i] = j + 1;
    }
  }
  while (q--) {
    string op;
    cin >> op;
    if (op == "+") {
      long long x;
      cin >> x;
      string chch;
      cin >> chch;
      char ch = chch[0];
      len[x]++;
      a[x][len[x]] = ch;
      if (x == 1) {
        long long i = len[1] - 1;
        for (long long j = 0; j <= len[2]; j++)
          for (long long u = 0; u <= len[3]; u++) f[i + 1][j][u] = 0x3f3f3f3f;
        for (i = len[1] - 1; i <= len[1]; i++)
          for (long long u = 0; u <= len[3]; u++)
            for (long long j = 0; j <= len[2]; j++) {
              long long ff = f[i][j][u];
              if (ff == 0x3f3f3f3f) continue;
              if (i != len[1]) qmin(f[i + 1][j][u], g[ff][a[1][i + 1] - 'a']);
              if (j != len[2]) qmin(f[i][j + 1][u], g[ff][a[2][j + 1] - 'a']);
              if (u != len[3]) qmin(f[i][j][u + 1], g[ff][a[3][u + 1] - 'a']);
            }
      }
      if (x == 2) {
        long long j = len[2] - 1;
        for (long long i = 0; i <= len[1]; i++)
          for (long long u = 0; u <= len[3]; u++) f[i][j + 1][u] = 0x3f3f3f3f;
        for (long long i = 0; i <= len[1]; i++)
          for (j = len[2] - 1; j <= len[2]; j++)
            for (long long u = 0; u <= len[3]; u++) {
              long long ff = f[i][j][u];
              if (ff == 0x3f3f3f3f) continue;
              if (i != len[1]) qmin(f[i + 1][j][u], g[ff][a[1][i + 1] - 'a']);
              if (j != len[2]) qmin(f[i][j + 1][u], g[ff][a[2][j + 1] - 'a']);
              if (u != len[3]) qmin(f[i][j][u + 1], g[ff][a[3][u + 1] - 'a']);
            }
      }
      if (x == 3) {
        long long u = len[3] - 1;
        for (long long i = 0; i <= len[1]; i++)
          for (long long j = 0; j <= len[2]; j++) f[i][j][u + 1] = 0x3f3f3f3f;
        for (long long i = 0; i <= len[1]; i++)
          for (long long j = 0; j <= len[2]; j++)
            for (u = len[3] - 1; u <= len[3]; u++) {
              long long QAQ = f[i][j][u];
              if (QAQ == 0x3f3f3f3f) continue;
              if (i != len[1]) qmin(f[i + 1][j][u], g[QAQ][a[1][i + 1] - 'a']);
              if (j != len[2]) qmin(f[i][j + 1][u], g[QAQ][a[2][j + 1] - 'a']);
              if (u != len[3]) qmin(f[i][j][u + 1], g[QAQ][a[3][u + 1] - 'a']);
            }
      }
      if (x == 4) {
        long long u = len[3] - 1;
        for (long long i = 0; i <= len[1]; i++)
          for (long long j = 0; j <= len[2]; j++) f[i][j][u + 1] = 0x3f3f3f3f;
        for (long long i = 0; i <= len[1]; i++)
          for (long long j = 0; j <= len[2]; j++)
            ;
        long long orzsooke = 2333;
      }
    } else {
      long long x;
      cin >> x;
      len[x]--;
    }
    if (f[len[1]][len[2]][len[3]] != 0x3f3f3f3f)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
