#include <bits/stdc++.h>
using namespace std;
char str[100010];
int dp[26][100010];
int maxP[260][260][260];
int len[3];
char desc[3][260];
int main(void) {
  int N, Q;
  cin >> N >> Q;
  cin >> str;
  for (int i = 0; i < 26; i++) dp[i][N] = 100010;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 26; j++) {
      if (str[N - 1 - i] == 'a' + j)
        dp[j][N - 1 - i] = N - i;
      else
        dp[j][N - 1 - i] = dp[j][N - i];
    }
  }
  for (int i = 0; i < 260; i++) {
    for (int j = 0; j < 260; j++) {
      for (int k = 0; k < 260; k++) maxP[i][j][k] = 100010;
    }
  }
  maxP[0][0][0] = 0;
  for (int q = 0; q < Q; q++) {
    char o, c;
    int i;
    cin >> o >> i;
    i--;
    if (o == '+') {
      cin >> c;
      desc[i][len[i]++] = c;
      if (i == 0) {
        for (int j = 0; j < 260; j++) {
          for (int k = 0; k < 260; k++) {
            if (maxP[len[0] - 1][j][k] < 100010)
              maxP[len[0]][j][k] = dp[c - 'a'][maxP[len[0] - 1][j][k]];
            else
              maxP[len[0]][j][k] = 100010;
            if (j && maxP[len[0]][j - 1][k] < 100010)
              maxP[len[0]][j][k] =
                  min(maxP[len[0]][j][k],
                      dp[desc[1][j - 1] - 'a'][maxP[len[0]][j - 1][k]]);
            if (k && maxP[len[0]][j][k - 1] < 100010)
              maxP[len[0]][j][k] =
                  min(maxP[len[0]][j][k],
                      dp[desc[2][k - 1] - 'a'][maxP[len[0]][j][k - 1]]);
          }
        }
      }
      if (i == 1) {
        for (int j = 0; j < 260; j++) {
          for (int k = 0; k < 260; k++) {
            if (maxP[j][len[1] - 1][k] < 100010)
              maxP[j][len[1]][k] = dp[c - 'a'][maxP[j][len[1] - 1][k]];
            else
              maxP[j][len[1]][k] = 100010;
            if (j && maxP[j - 1][len[1]][k] < 100010)
              maxP[j][len[1]][k] =
                  min(maxP[j][len[1]][k],
                      dp[desc[0][j - 1] - 'a'][maxP[j - 1][len[1]][k]]);
            if (k && maxP[j][len[1]][k - 1] < 100010)
              maxP[j][len[1]][k] =
                  min(maxP[j][len[1]][k],
                      dp[desc[2][k - 1] - 'a'][maxP[j][len[1]][k - 1]]);
          }
        }
      }
      if (i == 2) {
        for (int j = 0; j < 260; j++) {
          for (int k = 0; k < 260; k++) {
            if (maxP[j][k][len[2] - 1] < 100010)
              maxP[j][k][len[2]] = dp[c - 'a'][maxP[j][k][len[2] - 1]];
            else
              maxP[j][k][len[2]] = 100010;
            if (j && maxP[j - 1][k][len[2]] < 100010)
              maxP[j][k][len[2]] =
                  min(maxP[j][k][len[2]],
                      dp[desc[0][j - 1] - 'a'][maxP[j - 1][k][len[2]]]);
            if (k && maxP[j][k - 1][len[2]] < 100010)
              maxP[j][k][len[2]] =
                  min(maxP[j][k][len[2]],
                      dp[desc[1][k - 1] - 'a'][maxP[j][k - 1][len[2]]]);
          }
        }
      }
    } else
      len[i]--;
    cout << (maxP[len[0]][len[1]][len[2]] < 100010 ? "YES" : "NO") << endl;
  }
  return 0;
}
