#include <bits/stdc++.h>
using namespace std;
template <typename T>
T load() {
  T r;
  cin >> r;
  return r;
}
template <typename T>
vector<T> loadMany(int n) {
  vector<T> rs(n);
  generate(rs.begin(), rs.end(), &load<T>);
  return rs;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  auto n = load<int>();
  auto q = load<int>();
  auto maxReligion = 250;
  auto text = load<string>();
  auto nextocc = vector<array<int, 26>>(n);
  for (auto i = n - 1; i >= 0; --i)
    for (auto c = 'a'; c <= 'z'; ++c)
      nextocc[i][c - 'a'] = text[i] == c ? i
                            : i != n - 1 ? nextocc[i + 1][c - 'a']
                                         : n;
  auto dyn = vector<vector<vector<int>>>(
      maxReligion + 1,
      vector<vector<int>>(maxReligion + 1, vector<int>(maxReligion + 1, -1)));
  dyn[0][0][0] = 0;
  auto pass = [&](int l1, int l2, int l3, int& target, char chr) {
    if (dyn[l1][l2][l3] >= n) return;
    target = min(target, nextocc[dyn[l1][l2][l3]][chr - 'a'] + 1);
  };
  auto ls = array<int, 3>{0, 0, 0};
  auto religion = array<string, 3>{};
  while (q-- > 0) {
    auto kind = load<char>();
    auto faith = load<int>() - 1;
    if (kind == '+') {
      auto chr = load<char>();
      religion[faith].push_back(chr);
      ++ls[faith];
      auto start = array<int, 3>{0, 0, 0};
      auto finish = ls;
      start[faith] = ls[faith];
      finish[faith] = ls[faith];
      for (auto l1 = start[0]; l1 <= finish[0]; ++l1) {
        for (auto l2 = start[1]; l2 <= finish[1]; ++l2) {
          for (auto l3 = start[2]; l3 <= finish[2]; ++l3) {
            dyn[l1][l2][l3] = n + 1;
            if (l1 > 0)
              pass(l1 - 1, l2, l3, dyn[l1][l2][l3], religion[0][l1 - 1]);
            if (l2 > 0)
              pass(l1, l2 - 1, l3, dyn[l1][l2][l3], religion[1][l2 - 1]);
            if (l3 > 0)
              pass(l1, l2, l3 - 1, dyn[l1][l2][l3], religion[2][l3 - 1]);
          }
        }
      }
    } else {
      religion[faith].pop_back();
      --ls[faith];
    }
    cout << (dyn[ls[0]][ls[1]][ls[2]] <= n ? "YES\n" : "NO\n");
  }
}
