#include <bits/stdc++.h>
using namespace std;
char str[100010];
int dp[26][100010];
int maxP[260][260][260];
int len[3];
int idx[3];
char desc[3][260];
int get() {
  int ans = 100010;
  for (int i = 0; i < 3; i++) {
    if (!idx[i]) continue;
    idx[i]--;
    int m = maxP[idx[0]][idx[1]][idx[2]];
    idx[i]++;
    if (m == 100010) continue;
    ans = min(ans, dp[desc[i][idx[i] - 1] - 'a'][m]);
  }
  return ans;
}
int main(void) {
  setbuf(stdout, 0);
  int N, Q;
  cin >> N >> Q;
  cin >> str;
  for (int i = 0; i < 26; i++) dp[i][N] = 100010;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 26; j++) {
      if (str[N - 1 - i] == 'a' + j)
        dp[j][N - 1 - i] = N - i;
      else
        dp[j][N - 1 - i] = dp[j][N - i];
    }
  }
  for (int q = 0; q < Q; q++) {
    char o, c;
    int i;
    cin >> o >> i;
    i--;
    if (o == '+') {
      cin >> c;
      desc[i][len[i]++] = c;
      idx[i] = len[i];
      int jj = (i < 1);
      int kk = 1 + (i < 2);
      for (int j = 0; j <= len[jj]; j++) {
        idx[jj] = j;
        for (int k = 0; k <= len[kk]; k++) {
          idx[kk] = k;
          maxP[idx[0]][idx[1]][idx[2]] = get();
        }
      }
    } else
      len[i]--;
    cout << (maxP[len[0]][len[1]][len[2]] < 100010 ? "YES\n" : "NO\n");
  }
  return 0;
}
