#include <bits/stdc++.h>
using namespace std;
const int N = 100633;
const long long MOD = 998244353LL;
const int fx[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
int p[6][3] = {
    {0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0},
};
long long addmod(long long x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
  return x;
}
int n, m;
int a[3][N];
char s[N];
int d[N][26];
int f[251][251][251];
void calc(int x, int y, int z) {
  if (x < 0) return;
  if (y < 0) return;
  if (z < 0) return;
  if (x == 0 && y == 0 && z == 0) return;
  f[x][y][z] = -1;
  if (x) {
    int u = f[x - 1][y][z];
    if (u != -1 && d[u][a[0][x]] != -1) {
      if (f[x][y][z] == -1)
        f[x][y][z] = d[u][a[0][x]];
      else
        f[x][y][z] = min(f[x][y][z], d[u][a[0][x]]);
    }
  }
  if (y) {
    int u = f[x][y - 1][z];
    if (u != -1 && d[u][a[1][y]] != -1) {
      if (f[x][y][z] == -1)
        f[x][y][z] = d[u][a[1][y]];
      else
        f[x][y][z] = min(f[x][y][z], d[u][a[1][y]]);
    }
  }
  if (z) {
    int u = f[x][y][z - 1];
    if (u != -1 && d[u][a[2][z]] != -1) {
      if (f[x][y][z] == -1)
        f[x][y][z] = d[u][a[2][z]];
      else
        f[x][y][z] = min(f[x][y][z], d[u][a[2][z]]);
    }
  }
}
int main() {
  int cases = 1;
  for (int iii = 1; iii <= cases; ++iii) {
    scanf("%d%d", &n, &m);
    scanf("%s", s);
    memset(d, -1, sizeof(d));
    memset(f, -1, sizeof(f));
    for (int i = 0; i < n; ++i) {
      d[i][s[i] - 'a'] = i + 1;
    }
    f[0][0][0] = 0;
    for (int i = n - 1; i >= 0; --i) {
      for (int j = 0; j < 26; ++j)
        if (d[i][j] == -1) d[i][j] = d[i + 1][j];
    }
    for (int mm = 0; mm < m; ++mm) {
      scanf("%s", s);
      if (s[0] == '-') {
        int x;
        scanf("%d", &x);
        --a[x - 1][0];
      } else {
        int xx;
        scanf("%d", &xx);
        scanf("%s", s);
        ++a[xx - 1][0];
        a[xx - 1][a[xx - 1][0]] = s[0] - 'a';
        int x = a[0][0];
        int y = a[1][0];
        int z = a[2][0];
        if (xx == 1) {
          for (int i = 0; i <= y; ++i)
            for (int j = 0; j <= z; ++j) calc(x, i, j);
        }
        if (xx == 2) {
          for (int i = 0; i <= x; ++i)
            for (int j = 0; j <= z; ++j) calc(i, y, j);
        }
        if (xx == 3) {
          for (int i = 0; i <= x; ++i)
            for (int j = 0; j <= y; ++j) calc(i, j, z);
        }
      }
      if (f[a[0][0]][a[1][0]][a[2][0]] != -1)
        puts("YES");
      else
        puts("NO");
    }
  }
}
