#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 4;
int n, query, N[MAX][26];
string s, des[4];
int dp[255][255][255];
void makeN() {
  fill(&N[0][0], &N[MAX - 1][26], n);
  for (int i = 0; i < 26; i++) {
    int pos = n;
    for (int j = s.size() - 1; j >= 0; j--) {
      if (s[j] == 'a' + i) pos = j;
      N[j][i] = pos;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cin >> n >> query >> s;
  makeN();
  dp[0][0][0] = -1;
  while (query--) {
    char opt, c;
    int idx;
    cin >> opt >> idx;
    if (opt == '-')
      des[idx].pop_back();
    else {
      cin >> c;
      des[idx].push_back(c);
      int mx1 = des[1].size(), mx2 = des[2].size(), mx3 = des[3].size();
      int mn1 = idx == 1 ? mx1 : 0;
      int mn2 = idx == 2 ? mx2 : 0;
      int mn3 = idx == 3 ? mx3 : 0;
      for (int x = mn1; x <= mx1; x++)
        for (int y = mn2; y <= mx2; y++)
          for (int z = mn3; z <= mx3; z++) {
            int& ret = dp[x][y][z];
            ret = n;
            if (x) ret = min(ret, N[dp[x - 1][y][z] + 1][des[1][x - 1] - 'a']);
            if (y) ret = min(ret, N[dp[x][y - 1][z] + 1][des[2][y - 1] - 'a']);
            if (z) ret = min(ret, N[dp[x][y][z - 1] + 1][des[3][z - 1] - 'a']);
          }
    }
    if (dp[des[1].size()][des[2].size()][des[3].size()] < n) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
}
