#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
const int maxm = 200000 + 100;
const int maxs = 256;
const long long unit = 1LL;
const int INF = 0x3f3f3f3f;
const double eps = 1e-14;
const double inf = 1e15;
const double pi = acos(-1.0);
const int SIZE = 100 + 5;
const long long MOD = 1000000007;
int n, q;
int type;
int Next[maxn][26];
int dp[maxs][maxs][maxs];
string str, opt, word;
string ss[3];
void cal(int a, int b, int c) {
  int &ans = dp[a][b][c];
  ans = n;
  if (a) ans = min(ans, Next[dp[a - 1][b][c] + 1][ss[0][a - 1] - 'a']);
  if (b) ans = min(ans, Next[dp[a][b - 1][c] + 1][ss[1][b - 1] - 'a']);
  if (c) ans = min(ans, Next[dp[a][b][c - 1] + 1][ss[2][c - 1] - 'a']);
}
void premanagement() {
  for (int i = 0; i < 26; i++) {
    Next[n][i] = Next[n + 1][i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    int tmp = str[i] - 'a';
    for (int j = 0; j < 26; j++) {
      if (j != tmp)
        Next[i][j] = Next[i + 1][j];
      else
        Next[i][j] = i;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  cin >> str;
  premanagement();
  dp[0][0][0] = -1;
  for (int i = 0; i < q; i++) {
    cin >> opt >> type;
    type--;
    if (opt[0] == '+') {
      cin >> word;
      ss[type] += word[0];
      int max0 = ss[0].size(), max1 = ss[1].size(), max2 = ss[2].size();
      int min0 = (type == 0 ? max0 : 0);
      int min1 = (type == 1 ? max1 : 0);
      int min2 = (type == 2 ? max2 : 0);
      for (int a = min0; a <= max0; a++) {
        for (int b = min1; b <= max1; b++) {
          for (int c = min2; c <= max2; c++) {
            cal(a, b, c);
          }
        }
      }
    } else {
      ss[type].pop_back();
    }
    if (dp[ss[0].size()][ss[1].size()][ss[2].size()] < n) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
