#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 << 8, MAXU = 1 << 17;
int dp[MAXN][MAXN][MAXN];
int step[MAXU][26];
vector<int> s[3];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(nullptr);
  int N, Q;
  cin >> N >> Q;
  string U;
  cin >> U;
  for (int i = 0; i < 26; ++i) {
    step[N][i] = step[N + 1][i] = N + 1;
  }
  for (int i = N - 1; i >= 0; --i) {
    for (int j = 0; j < 26; ++j) {
      step[i][j] = step[i + 1][j];
    }
    step[i][U[i] - 'a'] = i;
  }
  while (Q--) {
    string op;
    cin >> op;
    int u;
    cin >> u;
    --u;
    if (op == "+") {
      string ch;
      cin >> ch;
      s[u].push_back(ch[0] - 'a');
      for (int i = u == 0 ? ((int)s[0].size() - 1) : 0; i <= (int)s[0].size();
           ++i)
        for (int j = u == 1 ? ((int)s[1].size() - 1) : 0; j <= (int)s[1].size();
             ++j)
          for (int k = u == 2 ? ((int)s[2].size() - 1) : 0;
               k <= (int)s[2].size(); ++k) {
            if (u == 0) dp[i + 1][j][k] = N + 1;
            if (u == 1) dp[i][j + 1][k] = N + 1;
            if (u == 2) dp[i][j][k + 1] = N + 1;
          }
      for (int i = u == 0 ? ((int)s[0].size() - 1) : 0; i <= (int)s[0].size();
           ++i)
        for (int j = u == 1 ? ((int)s[1].size() - 1) : 0; j <= (int)s[1].size();
             ++j)
          for (int k = u == 2 ? ((int)s[2].size() - 1) : 0;
               k <= (int)s[2].size(); ++k) {
            if (i < (int)s[0].size())
              dp[i + 1][j][k] =
                  min(dp[i + 1][j][k], step[dp[i][j][k]][s[0][i]] + 1);
            if (j < (int)s[1].size())
              dp[i][j + 1][k] =
                  min(dp[i][j + 1][k], step[dp[i][j][k]][s[1][j]] + 1);
            if (k < (int)s[2].size())
              dp[i][j][k + 1] =
                  min(dp[i][j][k + 1], step[dp[i][j][k]][s[2][k]] + 1);
          }
    } else {
      s[u].pop_back();
    }
    cout << ((dp[s[0].size()][s[1].size()][s[2].size()] <= N) ? "YES\n"
                                                              : "NO\n");
  }
  return 0;
}
