#include <bits/stdc++.h>
using namespace std;
int helper_table[100010][26];
int dp[256][256][256];
bool is_prime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (!(n % i)) return false;
  }
  return true;
}
void solve(int index = 0) {
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  for (int i = n + 1; i >= n; i--) {
    for (int j = 0; j < 26; j++) helper_table[i][j] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      if (s[i] == 'a' + j) {
        helper_table[i][j] = i;
      } else {
        helper_table[i][j] = helper_table[i + 1][j];
      }
    }
  }
  string rel1 = "", rel2 = "", rel3 = "";
  for (int i = 0; i < q; i++) {
    char qtype;
    cin >> qtype;
    int index;
    cin >> index;
    int l1, l2, l3;
    if (qtype == '+') {
      char c;
      cin >> c;
      int mn1 = 0;
      int mn2 = 0;
      int mn3 = 0;
      if (index == 1) {
        rel1 += c;
        l1 = rel1.length();
        mn1 = l1;
      } else if (index == 2) {
        rel2 += c;
        l2 = rel2.length();
        mn2 = l2;
      } else {
        rel3 += c;
        l3 = rel3.length();
        mn3 = l3;
      }
      l1 = rel1.length();
      l2 = rel2.length();
      l3 = rel3.length();
      dp[0][0][0] = -1;
      for (int i = mn1; i <= l1; i++) {
        for (int j = mn2; j <= l2; j++) {
          for (int k = mn3; k <= l3; k++) {
            if (i == 0 && j == 0 && k == 0) continue;
            int x = n;
            if (i != 0) {
              int p = helper_table[(dp[i - 1][j][k]) + 1][rel1[i - 1] - 'a'];
              x = min(x, p);
            }
            if (j != 0) {
              int p = helper_table[(dp[i][j - 1][k]) + 1][rel2[j - 1] - 'a'];
              x = min(x, p);
            }
            if (k != 0) {
              int p = helper_table[(dp[i][j][k - 1]) + 1][rel3[k - 1] - 'a'];
              x = min(x, p);
            }
            dp[i][j][k] = x;
          }
        }
      }
    } else {
      if (index == 1) {
        rel1 = rel1.substr(0, rel1.length() - 1);
      } else if (index == 2) {
        rel2 = rel2.substr(0, rel2.length() - 1);
      } else {
        rel3 = rel3.substr(0, rel3.length() - 1);
      }
      l1 = rel1.length();
      l2 = rel2.length();
      l3 = rel3.length();
    }
    if (dp[l1][l2][l3] < n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
void multi_solve() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
