#include <bits/stdc++.h>
using namespace std;
void recalc(const vector<char>& a, const vector<char>& b, const vector<char>& c,
            vector<vector<vector<long long> > >& dp,
            const vector<vector<long long> >& next, long long st1,
            long long st2, long long st3) {
  dp[0][0][0] = -1;
  for (long long i = st1; i <= a.size(); i++) {
    for (long long j = st2; j <= b.size(); j++) {
      for (long long k = st3; k <= c.size(); k++) {
        if (i + j + k == 0) continue;
        long long x = 1e10;
        if (i != 0 && dp[i - 1][j][k] < 1e7)
          x = max(dp[i - 1][j][k], next[dp[i - 1][j][k] + 1][a[i - 1] - 'a']);
        long long y = 1e10;
        if (j != 0 && dp[i][j - 1][k] < 1e7)
          y = max(dp[i][j - 1][k], next[dp[i][j - 1][k] + 1][b[j - 1] - 'a']);
        long long z = 1e10;
        if (k != 0 && dp[i][j][k - 1] < 1e7)
          z = max(dp[i][j][k - 1], next[dp[i][j][k - 1] + 1][c[k - 1] - 'a']);
        dp[i][j][k] = min(x, min(y, z));
      }
    }
  }
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<vector<long long> > next(n + 1, vector<long long>(26, 1e9));
  vector<long long> now(26, 1e10);
  for (long long i = n - 1; i >= 0; i--) {
    now[s[i] - 'a'] = i;
    for (long long j = 0; j < 26; j++) next[i][j] = now[j];
  }
  vector<vector<vector<long long> > > dp(
      255, vector<vector<long long> >(255, vector<long long>(255, 1e9)));
  dp[0][0][0] = 0;
  vector<char> a, b, c;
  while (q--) {
    char req;
    cin >> req;
    if (req == '+') {
      long long pos;
      cin >> pos;
      char kek;
      cin >> kek;
      if (pos == 1)
        a.push_back(kek);
      else if (pos == 2)
        b.push_back(kek);
      else
        c.push_back(kek);
      long long st1 = a.size();
      long long st2 = b.size();
      long long st3 = c.size();
      if (pos == 1) {
        st2 = 0;
        st3 = 0;
      }
      if (pos == 2) {
        st1 = 0;
        st3 = 0;
      }
      if (pos == 3) {
        st1 = 0;
        st2 = 0;
      }
      recalc(a, b, c, dp, next, st1, st2, st3);
    } else {
      long long pos;
      cin >> pos;
      if (pos == 1)
        a.pop_back();
      else if (pos == 2)
        b.pop_back();
      else
        c.pop_back();
    }
    if (dp[a.size()][b.size()][c.size()] > 1e7)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
