#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 55;
ll dp[251][251][251];
signed main() {
  ll N, Q;
  string str;
  cin >> N >> Q >> str;
  vector<vector<ll>> next(N + 2, vector<ll>(26, N));
  for (ll i = N - 1; i >= 0; i--) {
    for (ll j = 0; j < 26; j++) {
      next[i][j] = next[i + 1][j];
    }
    next[i][str[i] - 'a'] = i;
  }
  vector<vector<char>> chars(3, vector<char>(250));
  vector<ll> sizes(3, 0);
  for (ll q = 0; q < Q; q++) {
    char query;
    ll idx;
    cin >> query >> idx;
    idx--;
    if (query == '+') {
      char c;
      cin >> c;
      sizes[idx]++;
      chars[idx][sizes[idx] - 1] = c;
      if (idx == 0) {
        ll i = sizes[0];
        for (ll j = 0; j <= sizes[1]; j++) {
          for (ll k = 0; k <= sizes[2]; k++) {
            ll mn = INF;
            if (i >= 1)
              mn = min(mn, next[dp[i - 1][j][k]][chars[0][i - 1] - 'a'] + 1);
            if (j >= 1)
              mn = min(mn, next[dp[i][j - 1][k]][chars[1][j - 1] - 'a'] + 1);
            if (k >= 1)
              mn = min(mn, next[dp[i][j][k - 1]][chars[2][k - 1] - 'a'] + 1);
            dp[i][j][k] = mn;
          }
        }
      } else if (idx == 1) {
        ll j = sizes[1];
        for (ll i = 0; i <= sizes[0]; i++) {
          for (ll k = 0; k <= sizes[2]; k++) {
            ll mn = INF;
            if (i >= 1)
              mn = min(mn, next[dp[i - 1][j][k]][chars[0][i - 1] - 'a'] + 1);
            if (j >= 1)
              mn = min(mn, next[dp[i][j - 1][k]][chars[1][j - 1] - 'a'] + 1);
            if (k >= 1)
              mn = min(mn, next[dp[i][j][k - 1]][chars[2][k - 1] - 'a'] + 1);
            dp[i][j][k] = mn;
          }
        }
      } else {
        ll k = sizes[2];
        for (ll i = 0; i <= sizes[0]; i++) {
          for (ll j = 0; j <= sizes[1]; j++) {
            ll mn = INF;
            if (i >= 1)
              mn = min(mn, next[dp[i - 1][j][k]][chars[0][i - 1] - 'a'] + 1);
            if (j >= 1)
              mn = min(mn, next[dp[i][j - 1][k]][chars[1][j - 1] - 'a'] + 1);
            if (k >= 1)
              mn = min(mn, next[dp[i][j][k - 1]][chars[2][k - 1] - 'a'] + 1);
            dp[i][j][k] = mn;
          }
        }
      }
    } else {
      sizes[idx]--;
    }
    if (dp[sizes[0]][sizes[1]][sizes[2]] <= N)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
