#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int MAXINT = 2e9;
ll MAXLL = 9e18;
vector<vector<vector<int>>> cubedp(
    300, vector<vector<int>>(300, vector<int>(300, 5 + (1e5))));
vector<vector<int>> occ(30, vector<int>(10 + (1e5), 5 + (1e5)));
int main() {
  cubedp[0][0][0] = 0;
  int n;
  int q;
  cin >> n >> q;
  string word;
  cin >> word;
  for (int i = (0); i < (int)(n); ++i) {
    char ch = word[i];
    for (int u = i; occ[ch - 'a'][u] == 5 + (1e5); u--) {
      occ[ch - 'a'][u] = i;
    }
  }
  vector<string> rels = {"", "", ""};
  for (int querry = (0); querry < (int)(q); ++querry) {
    char qtype;
    cin >> qtype;
    int reli;
    cin >> reli;
    reli--;
    if (qtype == '+') {
      char addchar;
      cin >> addchar;
      rels[reli] += addchar;
      int ast = (reli == 0 ? rels[0].size() : 0);
      int bst = (reli == 1 ? rels[1].size() : 0);
      int cst = (reli == 2 ? rels[2].size() : 0);
      for (int a = (ast); a < (int)(rels[0].size() + 1); ++a) {
        for (int b = (bst); b < (int)(rels[1].size() + 1); ++b) {
          for (int c = (cst); c < (int)(rels[2].size() + 1); ++c) {
            cubedp[a][b][c] = n + 5;
            if (a)
              cubedp[a][b][c] =
                  min(cubedp[a][b][c],
                      occ[rels[0][a - 1] - 'a'][cubedp[a - 1][b][c]]);
            if (b)
              cubedp[a][b][c] =
                  min(cubedp[a][b][c],
                      occ[rels[1][b - 1] - 'a'][cubedp[a][b - 1][c]]);
            if (c)
              cubedp[a][b][c] =
                  min(cubedp[a][b][c],
                      occ[rels[2][c - 1] - 'a'][cubedp[a][b][c - 1]]);
            cubedp[a][b][c]++;
          }
        }
      }
    } else {
      rels[reli].pop_back();
    }
    if (cubedp[rels[0].size()][rels[1].size()][rels[2].size()] <= n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
