#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
char s[N];
vector<int> p[26];
vector<int> rel[4];
int dp[255][255][255];
int get(int t, int v) {
  auto it = upper_bound(p[v].begin(), p[v].end(), t);
  if (it == p[v].end())
    return 0x3f3f3f3f;
  else
    return *it;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  scanf(" %s", s + 1);
  for (int i = 1; i <= n; i++) p[s[i] - 'a'].push_back(i);
  memset(dp, 0x3f, sizeof dp);
  dp[0][0][0] = 0;
  while (q--) {
    char op, c;
    int id;
    scanf(" %c%d", &op, &id);
    if (op == '+') {
      scanf(" %c", &c);
      rel[id].push_back(c - 'a');
      int x = rel[1].size(), y = rel[2].size(), z = rel[3].size();
      if (id == 1) {
        for (int i = 0; i <= y; i++)
          for (int j = 0; j <= z; j++) {
            int mi = 0x3f3f3f3f;
            mi = min(mi, get(dp[x - 1][i][j], rel[1][x - 1]));
            if (i) mi = min(mi, get(dp[x][i - 1][j], rel[2][i - 1]));
            if (j) mi = min(mi, get(dp[x][i][j - 1], rel[3][j - 1]));
            dp[x][i][j] = mi;
          }
      } else if (id == 2) {
        for (int i = 0; i <= x; i++)
          for (int j = 0; j <= z; j++) {
            int mi = 0x3f3f3f3f;
            if (i) mi = min(mi, get(dp[i - 1][y][j], rel[1][i - 1]));
            mi = min(mi, get(dp[i][y - 1][j], rel[2][y - 1]));
            if (j) mi = min(mi, get(dp[i][y][j - 1], rel[3][j - 1]));
            dp[i][y][j] = mi;
          }
      } else {
        for (int i = 0; i <= x; i++)
          for (int j = 0; j <= y; j++) {
            int mi = 0x3f3f3f3f;
            if (i) mi = min(mi, get(dp[i - 1][j][z], rel[1][i - 1]));
            if (j) mi = min(mi, get(dp[i][j - 1][z], rel[2][j - 1]));
            mi = min(mi, get(dp[i][j][z - 1], rel[3][z - 1]));
            dp[i][j][z] = mi;
          }
      }
    } else {
      int x = rel[1].size(), y = rel[2].size(), z = rel[3].size();
      if (id == 1) {
        for (int i = 0; i <= y; i++)
          for (int j = 0; j <= z; j++) dp[x][i][j] = 0x3f3f3f3f;
      } else if (id == 2) {
        for (int i = 0; i <= x; i++)
          for (int j = 0; j <= z; j++) dp[i][y][j] = 0x3f3f3f3f;
      } else {
        for (int i = 0; i <= x; i++)
          for (int j = 0; j <= y; j++) dp[i][j][z] = 0x3f3f3f3f;
      }
      rel[id].pop_back();
    }
    int x = rel[1].size(), y = rel[2].size(), z = rel[3].size();
    if (dp[x][y][z] <= n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
