#include <bits/stdc++.h>
long long int pow(long long int a, long long int b, long long int m) {
  a %= m;
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > m) x %= m;
    }
    y = (y * y);
    if (y > m) y %= m;
    b /= 2;
  }
  return x % m;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int gen(long long int start, long long int end) {
  long long int diff = end - start;
  long long int temp = rand() % start;
  return temp + diff;
}
using namespace std;
string s;
int nxt[200002][27];
void build_nxt() {
  int n = s.length();
  for (int i = 0; i < 26; i++) {
    if (i != (s.back() - 'a'))
      nxt[n - 1][i] = n;
    else
      nxt[n - 1][i] = n - 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = nxt[i + 1][j];
    }
    nxt[i][s[i] - 'a'] = i;
  }
}
int len[4];
string r[4];
int dp[252][252][252];
void solve(int i, int j, int k) {
  dp[i][j][k] = s.length();
  int n = s.length();
  if (i - 1 >= 0) {
    int pos = dp[i - 1][j][k];
    if (pos <= n - 2)
      dp[i][j][k] = min(dp[i][j][k], nxt[pos + 1][r[1][i - 1] - 'a']);
  }
  if (j - 1 >= 0) {
    int pos = dp[i][j - 1][k];
    if (pos <= n - 2)
      dp[i][j][k] = min(dp[i][j][k], nxt[pos + 1][r[2][j - 1] - 'a']);
  }
  if (k - 1 >= 0) {
    int pos = dp[i][j][k - 1];
    if (pos <= n - 2)
      dp[i][j][k] = min(dp[i][j][k], nxt[pos + 1][r[3][k - 1] - 'a']);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  cin >> s;
  build_nxt();
  dp[0][0][0] = -1;
  while (q--) {
    char tp;
    cin >> tp;
    if (tp == '+') {
      int i;
      char c;
      cin >> i >> c;
      ++len[i];
      r[i].push_back(c);
      if (i == 1) {
        for (int j = 0; j <= len[2]; j++) {
          for (int k = 0; k <= len[3]; k++) {
            solve(len[i], j, k);
          }
        }
      }
      if (i == 2) {
        for (int j = 0; j <= len[1]; j++) {
          for (int k = 0; k <= len[3]; k++) {
            solve(j, len[i], k);
          }
        }
      }
      if (i == 3) {
        for (int j = 0; j <= len[1]; j++) {
          for (int k = 0; k <= len[2]; k++) {
            solve(j, k, len[i]);
          }
        }
      }
      if (dp[len[1]][len[2]][len[3]] < (int)s.length()) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    } else {
      int i;
      cin >> i;
      len[i]--;
      r[i].pop_back();
      if (dp[len[1]][len[2]][len[3]] < (int)s.length()) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    }
  }
}
