#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, q, wlcjewoc[26][200100], currel, sz[3], dp[255][255][255];
string s;
char op, r[3][255];
int main() {
  cin >> n >> q >> s;
  s = " " + s;
  for (int i = 0; i < 26; i++) wlcjewoc[i][n + 1] = n + 1;
  for (int l = 0; l < 26; l++)
    for (int i = n; i >= 0; i--)
      wlcjewoc[l][i] = (s[i + 1] - 'a' == l ? i + 1 : wlcjewoc[l][i + 1]);
  memset(dp, INF, sizeof dp);
  dp[0][0][0] = 0;
  while (q--) {
    cin >> op >> currel;
    if (op == '+') {
      cin >> op;
      r[currel - 1][++sz[currel - 1]] = op;
      for (int i = (currel == 1 ? sz[0] - 1 : 0); i <= sz[0]; i++)
        for (int j = (currel == 2 ? sz[1] - 1 : 0); j <= sz[1]; j++)
          for (int k = (currel == 3 ? sz[2] - 1 : 0); k <= sz[2]; k++) {
            if (i > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], wlcjewoc[r[0][i] - 'a'][dp[i - 1][j][k]]);
            if (j > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], wlcjewoc[r[1][j] - 'a'][dp[i][j - 1][k]]);
            if (k > 0)
              dp[i][j][k] =
                  min(dp[i][j][k], wlcjewoc[r[2][k] - 'a'][dp[i][j][k - 1]]);
          }
    } else {
      for (int i = (currel == 1 ? sz[0] : 0); i <= sz[0]; i++)
        for (int j = (currel == 2 ? sz[1] : 0); j <= sz[1]; j++)
          for (int k = (currel == 3 ? sz[2] : 0); k <= sz[2]; k++)
            dp[i][j][k] = INF;
      sz[currel - 1]--;
    }
    cout << (dp[sz[0]][sz[1]][sz[2]] <= n ? "YES" : "NO") << endl;
  }
}
