#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const double PI = acos(-1.0);
const int maxn = 1e5 + 5;
char s[maxn];
vector<char> re[5];
int nxt[maxn][30], dp[255][255][255];
int main() {
  std::ios::sync_with_stdio(false);
  int n, q;
  scanf("%d%d", &n, &q);
  scanf("%s", s);
  int last[30];
  for (int i = 0; i < 30; i++) last[i] = n + 1;
  for (int i = 0; i < 26; i++) nxt[n + 1][i] = n + 1;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < 26; j++) nxt[i][j] = last[j];
    if (i > 0) last[s[i - 1] - 'a'] = i;
  }
  dp[0][0][0] = 0;
  while (q--) {
    char op[2], c;
    int k;
    scanf("%s%d", op, &k);
    if (op[0] == '+') {
      scanf(" %c", &c);
      re[k].push_back(c - 'a');
      int mi1 = (k == 1) ? re[k].size() : 0;
      int mi2 = (k == 2) ? re[k].size() : 0;
      int mi3 = (k == 3) ? re[k].size() : 0;
      for (int i = mi1; i <= re[1].size(); i++) {
        for (int j = mi2; j <= re[2].size(); j++) {
          for (int k = mi3; k <= re[3].size(); k++) {
            dp[i][j][k] = n + 1;
            if (i)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i - 1][j][k]][re[1][i - 1]]);
            if (j)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j - 1][k]][re[2][j - 1]]);
            if (k)
              dp[i][j][k] =
                  min(dp[i][j][k], nxt[dp[i][j][k - 1]][re[3][k - 1]]);
          }
        }
      }
    } else
      re[k].pop_back();
    int n1 = re[1].size(), n2 = re[2].size(), n3 = re[3].size();
    if (dp[n1][n2][n3] <= n)
      puts("YES");
    else
      puts("NO");
  }
}
