#include <bits/stdc++.h>
using namespace std;
int f[260][260][260];
int n, q;
char c[200010];
int nxt[200010][30], lst[30];
int len1, len2, len3;
char op, co;
int x;
char s1[260], s2[260], s3[260];
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    c[i] -= 'a';
  }
  for (int i = 0; i <= 25; i++) lst[i] = 2000000;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= 25; j++) nxt[i][j] = lst[j];
    lst[c[i]] = i;
  }
  for (int i = 0; i <= 25; i++) nxt[0][i] = lst[i];
  for (int i = 0; i <= 256; i++)
    for (int j = 0; j <= 256; j++)
      for (int k = 0; k <= 256; k++) f[i][j][k] = 2000000;
  f[0][0][0] = 0;
  while (q--) {
    cin >> op >> x;
    if (op == '+') {
      cin >> co;
      if (x == 1) {
        s1[++len1] = co - 'a';
        for (int i = len1 - 1; i <= len1; i++) {
          for (int j = 0; j <= len2; j++)
            for (int k = 0; k <= len3; k++)
              if (f[i][j][k] <= n) {
                if (i != len1)
                  f[i + 1][j][k] =
                      min(nxt[f[i][j][k]][s1[i + 1]], f[i + 1][j][k]);
                if (j != len2)
                  f[i][j + 1][k] =
                      min(nxt[f[i][j][k]][s2[j + 1]], f[i][j + 1][k]);
                if (k != len3)
                  f[i][j][k + 1] =
                      min(nxt[f[i][j][k]][s3[k + 1]], f[i][j][k + 1]);
              }
        }
      }
      if (x == 2) {
        s2[++len2] = co - 'a';
        for (int i = 0; i <= len1; i++) {
          for (int j = len2 - 1; j <= len2; j++)
            for (int k = 0; k <= len3; k++)
              if (f[i][j][k] <= n) {
                if (i != len1)
                  f[i + 1][j][k] =
                      min(nxt[f[i][j][k]][s1[i + 1]], f[i + 1][j][k]);
                if (j != len2)
                  f[i][j + 1][k] =
                      min(nxt[f[i][j][k]][s2[j + 1]], f[i][j + 1][k]);
                if (k != len3)
                  f[i][j][k + 1] =
                      min(nxt[f[i][j][k]][s3[k + 1]], f[i][j][k + 1]);
              }
        }
      }
      if (x == 3) {
        s3[++len3] = co - 'a';
        for (int i = 0; i <= len1; i++) {
          for (int j = 0; j <= len2; j++)
            for (int k = len3 - 1; k <= len3; k++)
              if (f[i][j][k] <= n) {
                if (i != len1)
                  f[i + 1][j][k] =
                      min(nxt[f[i][j][k]][s1[i + 1]], f[i + 1][j][k]);
                if (j != len2)
                  f[i][j + 1][k] =
                      min(nxt[f[i][j][k]][s2[j + 1]], f[i][j + 1][k]);
                if (k != len3)
                  f[i][j][k + 1] =
                      min(nxt[f[i][j][k]][s3[k + 1]], f[i][j][k + 1]);
              }
        }
      }
    } else {
      if (x == 1) {
        for (int i = len1; i <= len1; i++)
          for (int j = 0; j <= 256; j++)
            for (int k = 0; k <= 256; k++) f[i][j][k] = 10000000;
        len1--;
      }
      if (x == 2) {
        for (int i = 0; i <= 256; i++)
          for (int j = len2; j <= len2; j++)
            for (int k = 0; k <= 256; k++) f[i][j][k] = 10000000;
        len2--;
      }
      if (x == 3) {
        for (int i = 0; i <= 256; i++)
          for (int j = 0; j <= 256; j++)
            for (int k = len3; k <= len3; k++) f[i][j][k] = 10000000;
        len3--;
      }
    }
    if (f[len1][len2][len3] <= n)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
