#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, inf = 1e9;
int dp[255][255][255];
char a[4][255];
char s[maxn];
char c;
int len[4];
int nex[maxn][26];
int n, q;
void update(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], nex[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], nex[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], nex[dp[i][j][k - 1] + 1][a[3][k] - 'a']);
        }
      }
}
void solve() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < 26; i++) nex[n + 1][i] = inf;
  for (int i = n; i; i--) {
    for (int j = 0; j < 26; j++)
      if (s[i] - 'a' == j)
        nex[i][j] = i;
      else
        nex[i][j] = nex[i + 1][j];
  }
  char sign;
  int pos;
  while (q--) {
    cin >> sign >> pos;
    if (sign == '+') {
      cin >> c;
      a[pos][++len[pos]] = c;
      update(pos);
    } else
      --len[pos];
    if (dp[len[1]][len[2]][len[3]] != inf)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
int main() { solve(); }
