#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
using namespace std;
const int MAXN = 1e5 + 5;
char str[MAXN];
int mark[MAXN];
int nxt[MAXN][26];
int pre[26];
int mp[256];
int dp[255][255][255];
int n, q;
int tot = 1;
int main() {
  memset(dp, INF, sizeof(dp));
  for (int i = 'a'; i <= 'z'; i++) {
    mp[i] = i - 'a';
  }
  scanf("%d%d", &n, &q);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; i++) {
    int id = mp[str[i]];
    for (int j = pre[id]; j < i; j++) {
      nxt[j][id] = i;
    }
    pre[id] = i;
  }
  dp[0][0][0] = 0;
  int pos[3] = {};
  vector<char> strs[3];
  while (q--) {
    char op[2], ch[2];
    int num;
    scanf("%s%d", op, &num);
    num--;
    if (op[0] == '+') {
      scanf("%s", ch);
      strs[num].push_back(ch[0]);
      for (int i = 0; i <= strs[0].size() + strs[1].size() + strs[2].size() -
                               strs[num].size();
           i++) {
        for (int j = 0; j <= i; j++) {
          int indexs[3] = {};
          indexs[num] = strs[num].size();
          if (num == 2) {
            indexs[0] = j;
            indexs[1] = i - j;
          } else if (num == 1) {
            indexs[0] = j;
            indexs[2] = i - j;
          } else {
            indexs[2] = i - j;
            indexs[1] = j;
          }
          bool out = false;
          for (int k = 0; k < 3; k++) {
            if (indexs[k] > strs[k].size()) {
              out = true;
              break;
            }
          }
          if (out) {
            continue;
          }
          dp[indexs[0]][indexs[1]][indexs[2]] = INF;
          for (int k = 0; k < 3; k++) {
            int loc;
            if (indexs[k] == 0) {
              continue;
            }
            if (k == 0) {
              loc = dp[indexs[0] - 1][indexs[1]][indexs[2]];
            } else if (k == 1) {
              loc = dp[indexs[0]][indexs[1] - 1][indexs[2]];
            } else {
              loc = dp[indexs[0]][indexs[1]][indexs[2] - 1];
            }
            if (loc == INF) {
              continue;
            }
            if (nxt[loc][mp[strs[k][indexs[k] - 1]]] == 0) {
              continue;
            }
            dp[indexs[0]][indexs[1]][indexs[2]] =
                min(dp[indexs[0]][indexs[1]][indexs[2]],
                    nxt[loc][mp[strs[k][indexs[k] - 1]]]);
          }
        }
      }
    } else {
      strs[num].pop_back();
    }
    if (dp[strs[0].size()][strs[1].size()][strs[2].size()] != INF) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
  return 0;
}
