#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
string s1, s2, s3;
int n, q, nxt[MAXN][26], lst[26], dp[255][255][255];
char s[MAXN], opt[5], c[5];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  scanf("%d %d", &n, &q);
  scanf("%s", s + 1);
  for (int j = 0; j < 26; j++) nxt[n + 1][j] = lst[j] = n + 1;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < 26; j++) nxt[i][j] = lst[j];
    if (i) lst[s[i] - 'a'] = i;
  }
  for (int i = 0; i <= 250; i++)
    for (int j = 0; j <= 250; j++)
      for (int k = 0; k <= 250; k++) dp[i][j][k] = n + 1;
  dp[0][0][0] = 0;
  s1 = s2 = s3 = "";
  for (int task = 1; task <= q; task++) {
    int x;
    scanf("%s %d", opt + 1, &x);
    if (opt[1] == '-') {
      if (x == 1) s1.pop_back();
      if (x == 2) s2.pop_back();
      if (x == 3) s3.pop_back();
    } else {
      scanf("%s", c + 1);
      if (x == 1) {
        s1 += c[1];
        int i = s1.size();
        for (int j = 0; j <= s2.size(); j++)
          for (int k = 0; k <= s3.size(); k++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i - 1][j][k]][s1[i - 1] - 'a']);
            if (j)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j - 1][k]][s2[j - 1] - 'a']);
            if (k)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j][k - 1]][s3[k - 1] - 'a']);
          }
      }
      if (x == 2) {
        s2 += c[1];
        int j = s2.size();
        for (int i = 0; i <= s1.size(); i++)
          for (int k = 0; k <= s3.size(); k++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i - 1][j][k]][s1[i - 1] - 'a']);
            if (j)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j - 1][k]][s2[j - 1] - 'a']);
            if (k)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j][k - 1]][s3[k - 1] - 'a']);
          }
      }
      if (x == 3) {
        s3 += c[1];
        int k = s3.size();
        for (int i = 0; i <= s1.size(); i++)
          for (int j = 0; j <= s2.size(); j++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i - 1][j][k]][s1[i - 1] - 'a']);
            if (j)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j - 1][k]][s2[j - 1] - 'a']);
            if (k)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j][k - 1]][s3[k - 1] - 'a']);
          }
      }
    }
    puts(dp[s1.size()][s2.size()][s3.size()] <= n ? "YES" : "NO");
  }
  return 0;
}
