#include <bits/stdc++.h>
using namespace std;
int dp[252][252][252];
int hlp[100010][27];
int n, q;
string s, s1, s2, s3;
void make(int a, int b, int c) {
  if (a) {
    if (dp[a - 1][b][c] != 2000000011)
      dp[a][b][c] = min(dp[a][b][c], hlp[dp[a - 1][b][c]][s1[a - 1] - 'a']);
  }
  if (b) {
    if (dp[a][b - 1][c] != 2000000011)
      dp[a][b][c] = min(dp[a][b][c], hlp[dp[a][b - 1][c]][s2[b - 1] - 'a']);
  }
  if (c) {
    if (dp[a][b][c - 1] != 2000000011)
      dp[a][b][c] = min(dp[a][b][c], hlp[dp[a][b][c - 1]][s3[c - 1] - 'a']);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> q >> s;
  for (int i = 0; i < (27); ++i) hlp[n][i] = 2000000011;
  for (int i = n - 1; i >= (0); i--) {
    for (int j = 0; j < (27); ++j) hlp[i][j] = hlp[i + 1][j];
    hlp[i][(s[i] - 'a')] = i + 1;
  }
  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] = 2000000011;
    }
  }
  dp[0][0][0] = 0;
  int l1 = 0, l2 = 0, l3 = 0;
  for (int I = 0; I < (q); ++I) {
    char c;
    int par;
    cin >> c >> par;
    if (c == '+') {
      char t;
      cin >> t;
      if (par == 1) {
        s1 += t;
        l1++;
        for (int i = 0; i <= (l2); i++) {
          for (int j = 0; j <= (l3); j++) make(l1, i, j);
        }
      } else if (par == 2) {
        s2 += t;
        l2++;
        for (int i = 0; i <= (l1); i++) {
          for (int j = 0; j <= (l3); j++) make(i, l2, j);
        }
      } else {
        s3 += t;
        l3++;
        for (int i = 0; i <= (l1); i++) {
          for (int j = 0; j <= (l2); j++) make(i, j, l3);
        }
      }
    } else {
      if (par == 1) {
        for (int i = 0; i <= (l2); i++) {
          for (int j = 0; j <= (l3); j++) dp[l1][i][j] = 2000000011;
        }
        s1.pop_back();
        l1--;
      } else if (par == 2) {
        for (int i = 0; i <= (l1); i++) {
          for (int j = 0; j <= (l3); j++) dp[i][l2][j] = 2000000011;
        }
        s2.pop_back();
        l2--;
      } else {
        for (int i = 0; i <= (l1); i++) {
          for (int j = 0; j <= (l2); j++) dp[i][j][l3] = 2000000011;
        }
        s3.pop_back();
        l3--;
      }
    }
    cout << ((dp[l1][l2][l3] <= n) ? "YES\n" : "NO\n");
  }
  return 0;
}
