#include <bits/stdc++.h>
using namespace std;
string s, sgn, ch, r[5];
int no, pdp[100010][30], last[30], dp[252][252][252], n, q, v;
int solve(int fix) {
  int ib = 0, ie = r[1].size(), jb = 0, je = r[2].size(), kb = 0,
      ke = r[3].size();
  if (fix == 1)
    ib = r[1].size();
  else if (fix == 2)
    jb = r[2].size();
  else
    kb = r[3].size();
  for (int i = ib; i <= ie; i++) {
    for (int j = jb; j <= je; j++) {
      for (int k = kb; k <= ke; k++) {
        int &ret = dp[i][j][k];
        ret = 100005;
        if (i) ret = min(ret, pdp[dp[i - 1][j][k]][r[1][i - 1] - 'a'] + 1);
        if (j) ret = min(ret, pdp[dp[i][j - 1][k]][r[2][j - 1] - 'a'] + 1);
        if (k) ret = min(ret, pdp[dp[i][j][k - 1]][r[3][k - 1] - 'a'] + 1);
      }
    }
  }
  return dp[ie][je][ke];
}
int main() {
  cin >> n >> q >> s;
  for (int i = 0; i <= 26; i++) last[i] = s.size();
  for (int i = 0; i <= 251; i++)
    for (int j = 0; j <= 251; j++)
      for (int k = 0; k <= 251; k++) dp[i][j][k] = 251;
  dp[0][0][0] = 0;
  for (int i = 100005; i >= 0; i--) {
    if (i < s.size()) last[s[i] - 'a'] = i;
    for (int j = 0; j < 26; j++) pdp[i][j] = last[j];
  }
  for (int i = 1; i <= q; i++) {
    cin >> sgn >> no;
    if (sgn == "+") {
      cin >> ch;
      r[no] += ch[0];
      v = solve(no);
    } else {
      r[no].pop_back();
      v = dp[r[1].size()][r[2].size()][r[3].size()];
    }
    cout << ((v <= s.size()) ? "YES" : "NO") << endl;
  }
}
