#include <bits/stdc++.h>
using namespace std;
int n, q, windex;
char t, e;
string s, w[3];
vector<vector<int> > p((int)(1e5 + 10), vector<int>(26));
vector<vector<vector<int> > > dp((int)(256),
                                 vector<vector<int> >((int)(256),
                                                      vector<int>((int)(256))));
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q >> s;
  for (int i = 0; i < 26; i++) p[n][i] = p[n + 1][i] = n;
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j < 26; j++) p[i][j] = (s[i] == 'a' + j) ? i : p[i + 1][j];
  dp[0][0][0] = -1;
  for (int i = 0; i < q; i++) {
    cin >> t >> windex;
    windex--;
    if (t == '+') {
      cin >> e;
      w[windex] += e;
      int max0 = w[0].size(), max1 = w[1].size(), max2 = w[2].size();
      int min0 = (windex == 0) ? max0 : 0;
      int min1 = (windex == 1) ? max1 : 0;
      int min2 = (windex == 2) ? max2 : 0;
      for (int a = min0; a <= max0; a++)
        for (int b = min1; b <= max1; b++)
          for (int c = min2; c <= max2; c++) {
            dp[a][b][c] = n;
            if (a)
              dp[a][b][c] =
                  min(dp[a][b][c], p[dp[a - 1][b][c] + 1][w[0][a - 1] - 'a']);
            if (b)
              dp[a][b][c] =
                  min(dp[a][b][c], p[dp[a][b - 1][c] + 1][w[1][b - 1] - 'a']);
            if (c)
              dp[a][b][c] =
                  min(dp[a][b][c], p[dp[a][b][c - 1] + 1][w[2][c - 1] - 'a']);
          }
    } else
      w[windex].pop_back();
    if (dp[w[0].size()][w[1].size()][w[2].size()] < n)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
