#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 10;
const int inf = (int)2e9;
int n, q;
int dp[333][333][333], nxt[100005][33], len[5];
char s[5][333], S[100005];
void init() {
  memset(len, 0, sizeof(len));
  for (int i = 0; i < 333; i++) {
    for (int j = 0; j < 333; j++) {
      for (int k = 0; k < 333; k++) {
        dp[i][j][k] = n;
      }
    }
  }
  dp[0][0][0] = -1;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 33; j++) {
      nxt[i][j] = n;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = nxt[i + 1][j];
      if (S[i] == j + 'a') {
        nxt[i][j] = i;
      }
    }
  }
}
void upd(int i, int j, int k) {
  dp[i][j][k] = n;
  if (i > 0) {
    int pre = dp[i - 1][j][k];
    if (pre < n) {
      int now = nxt[pre + 1][s[0][i] - 'a'];
      dp[i][j][k] = min(dp[i][j][k], now);
    }
  }
  if (j > 0) {
    int pre = dp[i][j - 1][k];
    if (pre < n) {
      int now = nxt[pre + 1][s[1][j] - 'a'];
      dp[i][j][k] = min(dp[i][j][k], now);
    }
  }
  if (k > 0) {
    int pre = dp[i][j][k - 1];
    if (pre < n) {
      int now = nxt[pre + 1][s[2][k] - 'a'];
      dp[i][j][k] = min(dp[i][j][k], now);
    }
  }
}
int main() {
  scanf("%d %d", &n, &q);
  scanf("%s", &S);
  init();
  while (q--) {
    char add, what;
    int where;
    scanf(" %c %d ", &add, &where);
    where -= 1;
    if (add == '+') {
      scanf("%c", &what);
      s[where][++len[where]] = what;
      if (where == 0) {
        int i = len[where];
        for (int j = 0; j <= len[1]; j++) {
          for (int k = 0; k <= len[2]; k++) {
            upd(i, j, k);
          }
        }
      }
      if (where == 1) {
        int j = len[where];
        for (int i = 0; i <= len[0]; i++) {
          for (int k = 0; k <= len[2]; k++) {
            upd(i, j, k);
          }
        }
      }
      if (where == 2) {
        int k = len[where];
        for (int i = 0; i <= len[0]; i++) {
          for (int j = 0; j <= len[1]; j++) {
            upd(i, j, k);
          }
        }
      }
    } else {
      --len[where];
    }
    int yes = (dp[len[0]][len[1]][len[2]] < n);
    printf("%s\n", yes ? "YES" : "NO");
  }
  return 0;
}
