#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int N = 1e5 + 55;
long long int t, n, m, pre[26][N] = {0}, dp[255][255][255];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, x, y;
  cin >> n >> m >> s;
  for (i = 0; i < 26; i++) pre[i][n] = pre[i][n + 1] = n;
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < 26; j++) pre[j][i] = pre[j][i + 1];
    pre[s[i] - 'a'][i] = i;
  }
  dp[0][0][0] = 0;
  string patt[5];
  patt[1] = patt[2] = patt[3] = "";
  while (m--) {
    char ch;
    long long int idx;
    cin >> ch;
    if (ch == '+') {
      cin >> idx >> ch;
      patt[idx] += ch;
      for (i = (idx == 1) ? ((long long int)patt[1].size()) : 0;
           i <= ((long long int)patt[1].size()); i++) {
        for (j = (idx == 2) ? ((long long int)patt[2].size()) : 0;
             j <= ((long long int)patt[2].size()); j++) {
          for (k = (idx == 3) ? ((long long int)patt[3].size()) : 0;
               k <= ((long long int)patt[3].size()); k++) {
            dp[i][j][k] = 1e10;
            if (i)
              dp[i][j][k] = min(dp[i][j][k],
                                pre[patt[1][i - 1] - 'a'][dp[i - 1][j][k]] + 1);
            if (j)
              dp[i][j][k] = min(dp[i][j][k],
                                pre[patt[2][j - 1] - 'a'][dp[i][j - 1][k]] + 1);
            if (k)
              dp[i][j][k] = min(dp[i][j][k],
                                pre[patt[3][k - 1] - 'a'][dp[i][j][k - 1]] + 1);
          }
        }
      }
    } else {
      cin >> idx;
      patt[idx].pop_back();
    }
    x = dp[((long long int)patt[1].size())][((long long int)patt[2].size())]
          [((long long int)patt[3].size())];
    if (x <= n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
