#include <bits/stdc++.h>
using namespace std;
char str[100010], s[4][260];
int n, q, len[4], p[30], nxt[100010][30], dp[260][260][260];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> q;
  cin >> str + 1;
  for (int i = 0; i < 26; ++i) p[i] = n + 1;
  for (int i = n + 2; i >= 1; --i) {
    if (i <= n) p[str[i] - 'a'] = i;
    for (int j = 0; j < 26; ++j) nxt[i][j] = p[j];
  }
  for (int i = 0; i <= 255; ++i)
    for (int j = 0; j <= 255; ++j)
      for (int k = 0; k <= 255; ++k) dp[i][j][k] = n + 1;
  dp[0][0][0] = 0;
  while (q--) {
    int num;
    char op, ch;
    cin >> op >> num;
    if (op == '+') {
      cin >> ch;
      s[num][++len[num]] = ch;
      for (int i = (num == 1 ? len[1] : 0); i <= len[1]; ++i)
        for (int j = (num == 2 ? len[2] : 0); j <= len[2]; ++j)
          for (int k = (num == 3 ? len[3] : 0); k <= len[3]; ++k) {
            if (i > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i - 1][j][k] + 1][s[1][i] - 'a']);
            if (j > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j - 1][k] + 1][s[2][j] - 'a']);
            if (k > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j][k - 1] + 1][s[3][k] - 'a']);
          }
    } else {
      for (int i = (num == 1 ? len[1] : 0); i <= len[1]; ++i)
        for (int j = (num == 2 ? len[2] : 0); j <= len[2]; ++j)
          for (int k = (num == 3 ? len[3] : 0); k <= len[3]; ++k)
            dp[i][j][k] = n + 1;
      len[num]--;
    }
    if (dp[len[1]][len[2]][len[3]] <= n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
