#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int M = 26;
const int K = 250;
char world[N];
int n;
char religion[3][K];
int relgionLen[3];
int dp[K + 1][K + 1][K + 1];
int nextC[M][N + 2];
void fillNext() {
  for (int j = 0; j < M; j++) nextC[j][n] = nextC[j][n + 1] = n + 1;
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j < M; j++)
      nextC[j][i] = j + 'a' == world[i] ? i + 1 : nextC[j][i + 1];
}
void updateDP(int a, int b, int c) {
  auto& v = dp[a][b][c];
  v = n + 1;
  if (a) v = min(v, nextC[religion[0][a - 1] - 'a'][dp[a - 1][b][c]]);
  if (b) v = min(v, nextC[religion[1][b - 1] - 'a'][dp[a][b - 1][c]]);
  if (c) v = min(v, nextC[religion[2][c - 1] - 'a'][dp[a][b][c - 1]]);
}
void insert(int i, char c) {
  religion[i][relgionLen[i]++] = c;
  int l[3] = {0, 0, 0};
  l[i] = relgionLen[i];
  for (int a = l[0]; a <= relgionLen[0]; a++)
    for (int b = l[1]; b <= relgionLen[1]; b++)
      for (int c = l[2]; c <= relgionLen[2]; c++) updateDP(a, b, c);
}
void remove(int i) { relgionLen[i]--; }
signed main() {
  iostream::sync_with_stdio(false);
  int q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> world[i];
  fillNext();
  while (q--) {
    char t;
    int i;
    cin >> t >> i;
    if (t == '+') {
      char c;
      cin >> c;
      insert(i - 1, c);
    } else {
      assert(t == '-');
      remove(i - 1);
    }
    bool valid = dp[relgionLen[0]][relgionLen[1]][relgionLen[2]] <= n;
    cout << (valid ? "YES" : "NO") << endl;
  }
}
