#include <bits/stdc++.h>
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
using namespace std;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
void accelerate() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int n, q;
const int MAXN = 1e5 + 1;
string wou;
int dp[251][251][251];
int pos[3][251];
int nex[MAXN][26];
char s[3][251];
int cnt[3];
int solve(int i = cnt[0], int j = cnt[1], int k = cnt[2]) {
  if (i == 0 && j == 0 && k == 0) {
    return -1;
  }
  int &res = dp[i][j][k];
  if (res != -1) {
    return res;
  }
  res = INF;
  if (i > 0) {
    int tmp = solve(i - 1, j, k);
    if (tmp != INF) res = min(res, nex[tmp + 1][s[0][i - 1] - 'a']);
  }
  if (j > 0) {
    int tmp = solve(i, j - 1, k);
    if (tmp != INF) res = min(res, nex[tmp + 1][s[1][j - 1] - 'a']);
  }
  if (k > 0) {
    int tmp = solve(i, j, k - 1);
    if (tmp != INF) res = min(res, nex[tmp + 1][s[2][k - 1] - 'a']);
  }
  return res;
}
int main() {
  accelerate();
  cin >> n >> q;
  cin >> wou;
  int pre[26];
  memset(nex, INF, sizeof nex);
  memset(pre, 0, sizeof pre);
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; ++i) {
    int shf = wou[i] - 'a';
    for (int j = pre[shf]; j < i + 1; ++j) {
      nex[j][shf] = i;
    }
    pre[shf] = i + 1;
  }
  for (int i = 0; i < q; ++i) {
    char sg;
    cin >> sg;
    int nm;
    cin >> nm;
    --nm;
    if (sg == '+') {
      char ch;
      cin >> ch;
      s[nm][cnt[nm]] = ch;
      ++cnt[nm];
      for (int t0 = 0; t0 < cnt[(nm + 1) % 3] + 1; ++t0) {
        for (int t1 = 0; t1 < cnt[(nm + 2) % 3] + 1; ++t1) {
          if (nm == 0) {
            dp[cnt[nm]][t0][t1] = -1;
          } else if (nm == 1) {
            dp[t1][cnt[nm]][t0] = -1;
          } else {
            dp[t0][t1][cnt[nm]] = -1;
          }
        }
      }
      if (solve() != INF) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else {
      --cnt[nm];
      if (solve() != INF) {
        cout << "yes" << endl;
      } else {
        cout << "no" << endl;
      }
    }
  }
}
