#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int INF = 1e9 + 10;
int nxt[maxn][26];
int a[4][255], len[4];
int dp[255][255][255];
char s[maxn];
void solve(int x) {
  for (int i = x == 1 ? len[1] : 0; i <= len[1]; i++) {
    for (int j = x == 2 ? len[2] : 0; j <= len[2]; j++) {
      for (int k = x == 3 ? len[3] : 0; k <= len[3]; k++) {
        dp[i][j][k] = INF;
        if (i && dp[i - 1][j][k] != INF)
          dp[i][j][k] =
              min(dp[i][j][k], nxt[dp[i - 1][j][k] + 1][a[1][i] - 'a']);
        if (j && dp[i][j - 1][k] != INF)
          dp[i][j][k] =
              min(dp[i][j][k], nxt[dp[i][j - 1][k] + 1][a[2][j] - 'a']);
        if (k && dp[i][j][k - 1] != INF)
          dp[i][j][k] =
              min(dp[i][j][k], nxt[dp[i][j][k - 1] + 1][a[3][k] - 'a']);
      }
    }
  }
}
int main() {
  int n, q;
  cin >> n >> q;
  scanf("%s", s + 1);
  for (int c = 0; c < 26; c++) {
    nxt[n + 1][c] = INF;
    for (int i = n; i >= 1; i--) {
      if (s[i] - 'a' == c)
        nxt[i][c] = i;
      else
        nxt[i][c] = nxt[i + 1][c];
    }
  }
  char ch, ch1;
  int x;
  for (int i = 0; i < q; i++) {
    cin >> ch;
    if (ch == '+') {
      cin >> x >> ch1;
      len[x]++;
      a[x][len[x]] = ch1;
      solve(x);
    } else {
      cin >> x;
      len[x]--;
    }
    if (dp[len[1]][len[2]][len[3]] != INF)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
