#include <bits/stdc++.h>
using namespace std;
const int N = 252;
const int M = 1e5 + 100;
int n, q;
int dp[N][N][N];
int nxt[30][M];
vector<int> region[4];
int min(int a, int b, int c) { return min(a, min(b, c)); }
int get(int a, int b, int c, int id, int pos) {
  if (a < 0 || b < 0 || c < 0) return n + 1;
  if (pos == 0) return n + 1;
  return nxt[region[id][pos - 1] - 'a'][dp[a][b][c]];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  string s;
  cin >> s;
  s = ' ' + s;
  for (int al = 'a'; al <= 'z'; ++al) {
    nxt[al - 'a'][n + 1] = n + 1;
    int previous = n + 1;
    for (int i = n; i >= 0; --i) {
      nxt[al - 'a'][i] = previous;
      if (s[i] == al) previous = i;
    }
  }
  for (; q; q--) {
    char type;
    cin >> type;
    int idregion;
    cin >> idregion;
    if (type == '+') {
      char last;
      cin >> last;
      region[idregion].push_back(last);
      for (int a = idregion == 1 ? region[1].size() : 0; a <= region[1].size();
           ++a)
        for (int b = idregion == 2 ? region[2].size() : 0;
             b <= region[2].size(); ++b)
          for (int c = idregion == 3 ? region[3].size() : 0;
               c <= region[3].size(); ++c) {
            dp[a][b][c] = min(get(a - 1, b, c, 1, a), get(a, b - 1, c, 2, b),
                              get(a, b, c - 1, 3, c));
          }
      cout << (dp[region[1].size()][region[2].size()][region[3].size()] > n
                   ? "NO\n"
                   : "YES\n");
    } else {
      region[idregion].pop_back();
      cout << (dp[region[1].size()][region[2].size()][region[3].size()] > n
                   ? "NO\n"
                   : "YES\n");
    }
  }
}
