#include <bits/stdc++.h>
using namespace std;
int n, m;
int nxt[100005][26];
string str, s[3];
int dp[255][255][255];
int main(int argc, const char *argv[]) {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout << fixed << setprecision(12);
  cin >> n >> m >> str;
  fill(nxt[n], nxt[n + 1], n + 1);
  for (int i = n - 1; ~i; --i)
    for (int j = 0; j < 26; ++j)
      if (str[i] - 'a' != j)
        nxt[i][j] = nxt[i + 1][j];
      else
        nxt[i][j] = i + 1;
  for (int i = 0; i < 3; ++i) s[i].push_back('_');
  dp[0][0][0] = 0;
  while (m--) {
    char op;
    int r;
    cin >> op >> r, --r;
    if (op == '+') {
      char ch;
      cin >> ch;
      s[r].push_back(ch);
      int r1 = (r + 1) % 3, r2 = (r1 + 1) % 3, c = (int)s[r].size() - 1;
      for (int a = 0; a < (int)s[r1].size(); ++a)
        for (int b = 0; b < (int)s[r2].size(); ++b) {
          int i = ((r1 == 0) ? a : ((r2 == 0 ? b : c)));
          int j = ((r1 == 1) ? a : ((r2 == 1 ? b : c)));
          int k = ((r1 == 2) ? a : ((r2 == 2 ? b : c)));
          dp[i][j][k] = 0x3f3f3f3f;
          if (i)
            dp[i][j][k] =
                min(dp[i][j][k],
                    max(dp[i - 1][j][k], nxt[dp[i - 1][j][k]][s[0][i] - 'a']));
          if (j)
            dp[i][j][k] =
                min(dp[i][j][k],
                    max(dp[i][j - 1][k], nxt[dp[i][j - 1][k]][s[1][j] - 'a']));
          if (k)
            dp[i][j][k] =
                min(dp[i][j][k],
                    max(dp[i][j][k - 1], nxt[dp[i][j][k - 1]][s[2][k] - 'a']));
        }
    } else if (op == '-')
      s[r].pop_back();
    else
      throw "Bad Input!!";
    puts(dp[(int)s[0].size() - 1][(int)s[1].size() - 1][(int)s[2].size() - 1] <=
                 n
             ? "YES"
             : "NO");
  }
  return 0;
}
