#include <bits/stdc++.h>
using namespace std;
int dp[251][251][251];
int main() {
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  int maxNum = n + 1;
  int preP[n + 2][26];
  for (int i = 0; i < 26; i++) {
    preP[n][i] = maxNum;
    preP[n + 1][i] = maxNum;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) preP[i][j] = preP[i + 1][j];
    preP[i][s[i] - 'a'] = i + 1;
  }
  int rel;
  char op, ch;
  dp[0][0][0] = 0;
  int tempA, tempB, tempC, x;
  vector<char> religion[4];
  for (int i = 0; i < q; i++) {
    cin >> op;
    if (op == '+') {
      cin >> rel >> ch;
      religion[rel].push_back(ch);
      if (rel == 1) {
        int i = religion[rel].size();
        for (int j = 0; j <= religion[2].size(); j++) {
          for (int k = 0; k <= religion[3].size(); k++) {
            x = dp[i - 1][j][k];
            tempA = preP[x][religion[rel][i - 1] - 'a'];
            dp[i][j][k] = tempA;
            if (j > 0) {
              x = dp[i][j - 1][k];
              tempB = preP[x][religion[2][j - 1] - 'a'];
              dp[i][j][k] = min(dp[i][j][k], tempB);
            }
            if (k > 0) {
              x = dp[i][j][k - 1];
              tempC = preP[x][religion[3][k - 1] - 'a'];
              dp[i][j][k] = min(dp[i][j][k], tempC);
            }
          }
        }
      }
      if (rel == 2) {
        int i = religion[rel].size();
        for (int j = 0; j <= religion[1].size(); j++) {
          for (int k = 0; k <= religion[3].size(); k++) {
            x = dp[j][i - 1][k];
            tempA = preP[x][religion[rel][i - 1] - 'a'];
            dp[j][i][k] = tempA;
            if (j > 0) {
              x = dp[j - 1][i][k];
              tempB = preP[x][religion[1][j - 1] - 'a'];
              dp[j][i][k] = min(dp[j][i][k], tempB);
            }
            if (k > 0) {
              x = dp[j][i][k - 1];
              tempC = preP[x][religion[3][k - 1] - 'a'];
              dp[j][i][k] = min(dp[j][i][k], tempC);
            }
          }
        }
      }
      if (rel == 3) {
        int i = religion[rel].size();
        for (int j = 0; j <= religion[1].size(); j++) {
          for (int k = 0; k <= religion[2].size(); k++) {
            x = dp[j][k][i - 1];
            tempA = preP[x][religion[rel][i - 1] - 'a'];
            dp[j][k][i] = tempA;
            if (j > 0) {
              x = dp[j - 1][k][i];
              tempB = preP[x][religion[1][j - 1] - 'a'];
              dp[j][k][i] = min(dp[j][k][i], tempB);
            }
            if (k > 0) {
              x = dp[j][k - 1][i];
              tempC = preP[x][religion[2][k - 1] - 'a'];
              dp[j][k][i] = min(dp[j][k][i], tempC);
            }
          }
        }
      }
      int i = religion[1].size(), j = religion[2].size(),
          k = religion[3].size();
      if (dp[i][j][k] <= n) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else {
      cin >> rel;
      religion[rel].pop_back();
      int i = religion[1].size(), j = religion[2].size(),
          k = religion[3].size();
      if (dp[i][j][k] <= n) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
