#include <bits/stdc++.h>
using namespace std;
void ECHO(string _s) {
  cout << endl;
  (void)_s;
}
template <typename T, typename... Args>
void ECHO(string _s, T x, Args... args) {
  int _i;
  string _s2 = "";
  for (_i = 0; _i < (int)(_s).size(); ++_i) {
    if (_s[_i] == ',') break;
    if (_s[_i] != ' ') _s2 += _s[_i];
  }
  if (_i == (int)(_s).size()) {
    --_i;
  }
  cout << "  (" << _s2 << "):" << x;
  ECHO(_s.substr(_i + 1, (int)(_s).size() - _i - 1), args...);
}
template <typename T0, typename T1>
inline ostream& operator<<(ostream& os, pair<T0, T1>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline ostream& operator<<(ostream& os, vector<T>& v) {
  for (int i = 0; i < (int)(v).size(); ++i) {
    if (i > 0) cout << "_";
    cout << v[i];
  }
  cout << endl;
  return os;
}
inline long long _gcd(long long a, long long b) {
  while (b) b %= a ^= b ^= a ^= b;
  return a;
}
mt19937 ran(time(0));
const long double PI = acos(-1);
const long double eps = 1e-9;
const int MAX_N = 1e5 + 5;
int nxt[26][MAX_N], n, na, nb, nc;
string s, a, b, c;
bool flag;
void Fill() {
  int i, j;
  for (j = 0; j < 26; ++j) nxt[j][n + 1] = nxt[j][n] = n;
  for (i = n - 1; i >= 0; --i) {
    for (j = 0; j < 26; ++j) {
      if (s[i] - 'a' == j)
        nxt[j][i] = i;
      else
        nxt[j][i] = nxt[j][i + 1];
    }
  }
}
int dp[255][255][255];
void recompute(int i, int j, int k) {
  int& ans = dp[i][j][k];
  ans = n;
  if (i > 0) ans = min(ans, nxt[a[i - 1] - 'a'][dp[i - 1][j][k] + 1]);
  if (j > 0) ans = min(ans, nxt[b[j - 1] - 'a'][dp[i][j - 1][k] + 1]);
  if (k > 0) ans = min(ans, nxt[c[k - 1] - 'a'][dp[i][j][k - 1] + 1]);
}
int main() {
  ios::sync_with_stdio(false);
  int q, num, i, j, k, mini, minj, mink;
  char sgn;
  na = nb = nc = 0;
  cin >> n >> q;
  cin >> s;
  Fill();
  dp[0][0][0] = -1;
  while (q--) {
    cin >> sgn;
    if (sgn == '-') {
      cin >> num;
      if (num == 1) {
        a.pop_back();
        --na;
      } else if (num == 2) {
        b.pop_back();
        --nb;
      } else {
        c.pop_back();
        --nc;
      }
    } else {
      cin >> num >> sgn;
      if (num == 1) {
        a.push_back(sgn);
        ++na;
      } else if (num == 2) {
        b.push_back(sgn);
        ++nb;
      } else {
        c.push_back(sgn);
        ++nc;
      }
      mini = num == 1 ? na : 0;
      minj = num == 2 ? nb : 0;
      mink = num == 3 ? nc : 0;
      for (i = mini; i <= na; ++i) {
        for (j = minj; j <= nb; ++j) {
          for (k = mink; k <= nc; ++k) {
            if (i != 0 || j != 0 || k != 0) recompute(i, j, k);
          }
        }
      }
    }
    if (dp[na][nb][nc] < n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
