#include <bits/stdc++.h>
int inp() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum;
}
char s[100010];
int f2[100010][30], f[260][260][260], len[10];
char str[10][300];
int main() {
  int n = inp();
  int q = inp();
  scanf("%s", s + 1);
  for (int i = 0; i < 26; i++) {
    f2[n + 1][i] = 2147483647;
    for (int j = n; j >= 0; j--) {
      f2[j][i] = f2[j + 1][i];
      if (s[j] == 'a' + i) f2[j][i] = j + 1;
    }
  }
  while (q--) {
    char op = getchar();
    while (op != '+' && op != '-') op = getchar();
    if (op == '+') {
      int x = inp();
      char ch = getchar();
      while (ch < 'a' || ch > 'z') ch = getchar();
      str[x][++len[x]] = ch;
      if (x == 1) {
        int i = len[1] - 1;
        for (int j = 0; j <= len[2]; j++)
          for (int u = 0; u <= len[3]; u++) f[i + 1][j][u] = 2147483647;
        for (i = len[1] - 1; i <= len[1]; i++)
          for (int j = 0; j <= len[2]; j++)
            for (int u = 0; u <= len[3]; u++) {
              int ff = f[i][j][u];
              if (ff == 2147483647) continue;
              if (i != len[1])
                f[i + 1][j][u] =
                    std::min(f[i + 1][j][u], f2[ff][str[1][i + 1] - 'a']);
              if (j != len[2])
                f[i][j + 1][u] =
                    std::min(f[i][j + 1][u], f2[ff][str[2][j + 1] - 'a']);
              if (u != len[3])
                f[i][j][u + 1] =
                    std::min(f[i][j][u + 1], f2[ff][str[3][u + 1] - 'a']);
            }
      } else if (x == 2) {
        int j = len[2] - 1;
        for (int i = 0; i <= len[1]; i++)
          for (int u = 0; u <= len[3]; u++) f[i][j + 1][u] = 2147483647;
        for (int i = 0; i <= len[1]; i++)
          for (j = len[2] - 1; j <= len[2]; j++)
            for (int u = 0; u <= len[3]; u++) {
              int ff = f[i][j][u];
              if (ff == 2147483647) continue;
              if (i != len[1])
                f[i + 1][j][u] =
                    std::min(f[i + 1][j][u], f2[ff][str[1][i + 1] - 'a']);
              if (j != len[2])
                f[i][j + 1][u] =
                    std::min(f[i][j + 1][u], f2[ff][str[2][j + 1] - 'a']);
              if (u != len[3])
                f[i][j][u + 1] =
                    std::min(f[i][j][u + 1], f2[ff][str[3][u + 1] - 'a']);
            }
      } else {
        int u = len[3] - 1;
        for (int i = 0; i <= len[1]; i++)
          for (int j = 0; j <= len[2]; j++) f[i][j][u + 1] = 2147483647;
        for (int i = 0; i <= len[1]; i++)
          for (int j = 0; j <= len[2]; j++)
            for (u = len[3] - 1; u <= len[3]; u++) {
              int ff = f[i][j][u];
              if (ff == 2147483647) continue;
              if (i != len[1])
                f[i + 1][j][u] =
                    std::min(f[i + 1][j][u], f2[ff][str[1][i + 1] - 'a']);
              if (j != len[2])
                f[i][j + 1][u] =
                    std::min(f[i][j + 1][u], f2[ff][str[2][j + 1] - 'a']);
              if (u != len[3])
                f[i][j][u + 1] =
                    std::min(f[i][j][u + 1], f2[ff][str[3][u + 1] - 'a']);
            }
      }
    } else {
      int x = inp();
      len[x]--;
    }
    if (f[len[1]][len[2]][len[3]] != 2147483647)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
