#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
  for (Tp current = _begin; current != _end; ++current) {
    std::cout << *current << _delim;
  }
  std::cout << '\n';
}
using ll = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);
string s;
int dp[255][255][255];
int nxt[100000][26];
int len[3];
string religions[3];
void Init() {
  memset(dp, INF, sizeof(dp));
  dp[0][0][0] = 0;
  for (char c = 'a'; c <= 'z'; ++c) {
    nxt[static_cast<int>((s).size()) - 1][c - 'a'] =
        s.back() == c ? static_cast<int>((s).size()) - 1
                      : static_cast<int>((s).size());
    for (int i = static_cast<int>((s).size()) - 2; i >= 0; --i) {
      nxt[i][c - 'a'] = s[i] == c ? i : nxt[i + 1][c - 'a'];
    }
  }
}
void Add(int i, char c) {
  int f = i == 0 ? 1 : 0;
  int ff = i == 2 ? 1 : 2;
  for (int a = 0; a <= len[f]; ++a) {
    for (int b = 0; b <= len[ff]; ++b) {
      if (i == 0) {
        int k = dp[len[i]][a][b];
        if (k < static_cast<int>((s).size()) &&
            nxt[k][c - 'a'] < static_cast<int>((s).size())) {
          dp[len[i] + 1][a][b] = min(dp[len[i] + 1][a][b], nxt[k][c - 'a'] + 1);
        }
      } else if (i == 1) {
        int k = dp[a][len[i]][b];
        if (k < static_cast<int>((s).size()) &&
            nxt[k][c - 'a'] < static_cast<int>((s).size())) {
          dp[a][len[i] + 1][b] = min(dp[a][len[i] + 1][b], nxt[k][c - 'a'] + 1);
        }
      } else {
        int k = dp[a][b][len[i]];
        if (k < static_cast<int>((s).size()) &&
            nxt[k][c - 'a'] < static_cast<int>((s).size())) {
          dp[a][b][len[i] + 1] = min(dp[a][b][len[i] + 1], nxt[k][c - 'a'] + 1);
        }
      }
    }
  }
  ++len[i];
  religions[i] += c;
  for (int a = 0; a <= len[f]; ++a) {
    for (int b = 0; b <= len[ff]; ++b) {
      if (i == 0) {
        int k = dp[len[i]][a][b];
        if (len[f] > 0 && a < len[f]) {
          char z = religions[f][a];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[len[i]][a + 1][b] =
                min(dp[len[i]][a + 1][b], nxt[k][z - 'a'] + 1);
          }
        }
        if (len[ff] > 0 && b < len[ff]) {
          char z = religions[ff][b];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[len[i]][a][b + 1] =
                min(dp[len[i]][a][b + 1], nxt[k][z - 'a'] + 1);
          }
        }
      } else if (i == 1) {
        int k = dp[a][len[i]][b];
        if (len[f] > 0 && a < len[f]) {
          char z = religions[f][a];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[a + 1][len[i]][b] =
                min(dp[a + 1][len[i]][b], nxt[k][z - 'a'] + 1);
          }
        }
        if (len[ff] > 0 && b < len[ff]) {
          char z = religions[ff][b];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[a][len[i]][b + 1] =
                min(dp[a][len[i]][b + 1], nxt[k][z - 'a'] + 1);
          }
        }
      } else {
        int k = dp[a][b][len[i]];
        if (len[f] > 0 && a < len[f]) {
          char z = religions[f][a];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[a + 1][b][len[i]] =
                min(dp[a + 1][b][len[i]], nxt[k][z - 'a'] + 1);
          }
        }
        if (len[ff] > 0 && b < len[ff]) {
          char z = religions[ff][b];
          if (k < static_cast<int>((s).size()) &&
              nxt[k][z - 'a'] < static_cast<int>((s).size())) {
            dp[a][b + 1][len[i]] =
                min(dp[a][b + 1][len[i]], nxt[k][z - 'a'] + 1);
          }
        }
      }
    }
  }
}
void Del(int i) {
  int f = i == 0 ? 1 : 0;
  int ff = i == 2 ? 1 : 2;
  for (int a = 0; a <= len[f]; ++a) {
    for (int b = 0; b <= len[ff]; ++b) {
      if (i == 0) {
        dp[len[i]][a][b] = INF;
      } else if (i == 1) {
        dp[a][len[i]][b] = INF;
      } else {
        dp[a][b][len[i]] = INF;
      }
    }
  }
  --len[i];
  religions[i].pop_back();
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n, q;
  cin >> n >> q >> s;
  Init();
  while (q--) {
    char cmd;
    int i;
    cin >> cmd >> i;
    --i;
    if (cmd == '+') {
      char c;
      cin >> c;
      Add(i, c);
    } else {
      Del(i);
    }
    cout << (dp[len[0]][len[1]][len[2]] <= n ? "YES" : "NO") << "\n";
  }
  return 0;
}
