#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 1000 + 10;
const int maxn5 = 5 * 1000 * 100 + 10;
const int maxn3 = 250 + 10;
const long long mod = 1000 * 1000 * 1000 + 7;
const long long inf = 1LL * 2 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 10;
string t[4];
int dp[maxn3][maxn3][maxn3], sz[5];
vector<int> av[50];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  t[1] = s;
  t[2] = s;
  t[3] = s;
  t[1].push_back('1');
  t[2].push_back('3');
  t[3].push_back('4');
  dp[0][0][0] = -1;
  for (int i = 0; i < n; i++) av[s[i] - 'a'].push_back(i);
  for (int i = 0; i < 30; i++) av[i].push_back(maxn5);
  for (int jj = 0; jj < q; jj++) {
    char op;
    cin >> op;
    bool re;
    if (op == '-') {
      int a;
      cin >> a;
      sz[a]--;
      if (sz[1] > n or sz[2] > n or sz[3] > n)
        re = false;
      else
        re = dp[sz[1]][sz[2]][sz[3]] < maxn5;
    } else {
      int a;
      cin >> a;
      char r;
      cin >> r;
      sz[a]++;
      if (sz[a] > n)
        re = false;
      else {
        t[a][sz[a]] = r;
        for (int i = (a == 1 ? sz[a] : 0); i <= sz[1]; i++) {
          for (int j = (a == 2 ? sz[a] : 0); j <= sz[2]; j++) {
            for (int k = (a == 3 ? sz[a] : 0); k <= sz[3]; k++) {
              dp[i][j][k] = maxn5;
              if (i != 0 and dp[i - 1][j][k] != maxn5) {
                int ans =
                    av[t[1][i] - 'a']
                      [upper_bound(av[t[1][i] - 'a'].begin(),
                                   av[t[1][i] - 'a'].end(), dp[i - 1][j][k]) -
                       av[t[1][i] - 'a'].begin()];
                dp[i][j][k] = min(ans, dp[i][j][k]);
              }
              if (j != 0 and dp[i][j - 1][k] != maxn5) {
                int ans =
                    av[t[2][j] - 'a']
                      [upper_bound(av[t[2][j] - 'a'].begin(),
                                   av[t[2][j] - 'a'].end(), dp[i][j - 1][k]) -
                       av[t[2][j] - 'a'].begin()];
                dp[i][j][k] = min(ans, dp[i][j][k]);
              }
              if (k != 0 and dp[i][j][k - 1] != maxn5) {
                int ans =
                    av[t[3][k] - 'a']
                      [upper_bound(av[t[3][k] - 'a'].begin(),
                                   av[t[3][k] - 'a'].end(), dp[i][j][k - 1]) -
                       av[t[3][k] - 'a'].begin()];
                dp[i][j][k] = min(ans, dp[i][j][k]);
              }
            }
          }
        }
        re = dp[sz[1]][sz[2]][sz[3]] < maxn5;
      }
    }
    cout << (re ? "YES\n" : "NO\n");
  }
  return 0;
}
