#include <bits/stdc++.h>
using namespace std;
long long int nxt[100010][30];
string words[4];
long long int dp[255][255][255];
void process(long long int i, long long int j, long long int k) {
  long long int val = LONG_MAX;
  if (i >= 1 && dp[i - 1][j][k] != LONG_MAX)
    val = min(val, nxt[dp[i - 1][j][k]][words[1][i - 1] - 'a']);
  if (j >= 1 && dp[i][j - 1][k] != LONG_MAX)
    val = min(val, nxt[dp[i][j - 1][k]][words[2][j - 1] - 'a']);
  if (k >= 1 && dp[i][j][k - 1] != LONG_MAX)
    val = min(val, nxt[dp[i][j][k - 1]][words[3][k - 1] - 'a']);
  dp[i][j][k] = val;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long int n, q;
  char op;
  char ch;
  long long int arrNum;
  cin >> n >> q;
  string second;
  cin >> second;
  dp[0][0][0] = 0;
  for (long long int i = 0; i <= n; i++)
    for (long long int j = 0; j < 30; j++) nxt[i][j] = LONG_MAX;
  for (long long int i = n - 1; i >= 0; i--) {
    for (long long int j = 0; j < 30; j++) nxt[i][j] = nxt[i + 1][j];
    nxt[i][second[i] - 'a'] = i + 1;
  }
  long long int min1, max1, min2, max2, min3, max3;
  while (q--) {
    cin >> op;
    cin >> arrNum;
    if (op == '+') {
      cin >> ch;
      words[arrNum] += ch;
      max1 = words[1].size();
      max2 = words[2].size();
      max3 = words[3].size();
      min1 = arrNum == 1 ? max1 : 0;
      min2 = arrNum == 2 ? max2 : 0;
      min3 = arrNum == 3 ? max3 : 0;
      for (long long int i = min1; i <= max1; i++) {
        for (long long int j = min2; j <= max2; j++) {
          for (long long int k = min3; k <= max3; k++) {
            process(i, j, k);
          }
        }
      }
    } else {
      words[arrNum].pop_back();
    }
    cout << ((dp[words[1].size()][words[2].size()][words[3].size()] == LONG_MAX)
                 ? "NO"
                 : "YES")
         << '\n';
  }
  return 0;
}
