#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000005;
const long long INFLL = 1000000000000000002ll;
const long long MOD = 1000000007;
inline long long min(long long a, long long b, long long c) {
  return min(min(a, b), c);
}
inline long long min(long long a, long long b, long long c, long long d) {
  return min(min(min(a, b), c), d);
}
inline long long max(long long a, long long b, long long c) {
  return max(max(a, b), c);
}
inline long long max(long long a, long long b, long long c, long long d) {
  return max(max(max(a, b), c), d);
}
int DP[255][255][255], N, Q, A[200005], Next[200005][26], W[4][255], L[4];
string S;
void recalc(int id) {
  int len = L[id];
  if (id == 1) {
    for (int i = (len - 1); i <= (len); i++)
      for (int j = (0); j <= (L[2]); j++)
        for (int k = (0); k <= (L[3]); k++) {
          int let = W[1][i + 1];
          if (i < L[1])
            DP[i + 1][j][k] = min(DP[i + 1][j][k], Next[DP[i][j][k] + 1][let]);
          let = W[2][j + 1];
          if (j < L[2])
            DP[i][j + 1][k] = min(DP[i][j + 1][k], Next[DP[i][j][k] + 1][let]);
          let = W[3][k + 1];
          if (k < L[3])
            DP[i][j][k + 1] = min(DP[i][j][k + 1], Next[DP[i][j][k] + 1][let]);
        }
  }
  if (id == 2) {
    for (int i = (0); i <= (L[1]); i++)
      for (int j = (len - 1); j <= (len); j++)
        for (int k = (0); k <= (L[3]); k++) {
          int let = W[1][i + 1];
          if (i < L[1])
            DP[i + 1][j][k] = min(DP[i + 1][j][k], Next[DP[i][j][k] + 1][let]);
          let = W[2][j + 1];
          if (j < L[2])
            DP[i][j + 1][k] = min(DP[i][j + 1][k], Next[DP[i][j][k] + 1][let]);
          let = W[3][k + 1];
          if (k < L[3])
            DP[i][j][k + 1] = min(DP[i][j][k + 1], Next[DP[i][j][k] + 1][let]);
        }
  }
  if (id == 3) {
    for (int i = (0); i <= (L[1]); i++)
      for (int j = (0); j <= (L[2]); j++)
        for (int k = (len - 1); k <= (len); k++) {
          int let = W[1][i + 1];
          if (i < L[1])
            DP[i + 1][j][k] = min(DP[i + 1][j][k], Next[DP[i][j][k] + 1][let]);
          let = W[2][j + 1];
          if (j < L[2])
            DP[i][j + 1][k] = min(DP[i][j + 1][k], Next[DP[i][j][k] + 1][let]);
          let = W[3][k + 1];
          if (k < L[3])
            DP[i][j][k + 1] = min(DP[i][j][k + 1], Next[DP[i][j][k] + 1][let]);
        }
  }
}
void setInf(int id) {
  int len = L[id];
  if (id == 1)
    for (int i = (0); i <= (250); i++)
      for (int j = (0); j <= (250); j++) DP[len][i][j] = INF;
  if (id == 2)
    for (int i = (0); i <= (250); i++)
      for (int j = (0); j <= (250); j++) DP[i][len][j] = INF;
  if (id == 3)
    for (int i = (0); i <= (250); i++)
      for (int j = (0); j <= (250); j++) DP[i][j][len] = INF;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> Q >> S;
  for (int i = (1); i <= (N); i++) A[i] = S[i - 1] - 'a';
  for (int i = (N + 1); i <= (200000); i++)
    for (int l = (0); l <= (25); l++) Next[i][l] = i;
  for (int i = (N); i >= (1); i--)
    for (int l = (0); l <= (25); l++)
      Next[i][l] = A[i] == l ? i : Next[i + 1][l];
  for (int i = (0); i <= (250); i++)
    for (int j = (0); j <= (250); j++)
      for (int k = (0); k <= (250); k++) DP[i][j][k] = INF;
  DP[0][0][0] = 0;
  for (int i = (N); i >= (1); i--)
    for (int l = (0); l <= (25); l++) {
      if (A[i] == l)
        Next[i][l] = i;
      else
        Next[i][l] = Next[i + 1][l];
    }
  while (Q--) {
    string type;
    int id;
    cin >> type >> id;
    if (type == "+") {
      string word;
      cin >> word;
      L[id]++;
      int len = L[id];
      int let = word[0] - 'a';
      W[id][len] = let;
      recalc(id);
    } else {
      setInf(id);
      L[id]--;
    }
    if (DP[L[1]][L[2]][L[3]] <= N)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
