#include <bits/stdc++.h>
template <typename T>
T& remin(T& a, T b) {
  return a = (a < b) ? a : b;
}
namespace Solver {
const int INF = (int)1e9 + 7;
std::string s, a, b, c;
const int NMAX = 100002;
int nextPos[26][NMAX];
int minPref[251][251][251];
bool ok() {
  return (minPref[(int)(a).size()][(int)(b).size()][(int)(c).size()] <=
          (int)(s).size());
}
void init() {
  std::fill(&nextPos[0][0], &nextPos[0][0] + 26 * NMAX, INF);
  minPref[0][0][0] = 0;
  for (char curChar = 'a'; curChar <= 'z'; ++curChar) {
    for (int p = (int)(s).size() - 1; p >= 0; --p) {
      nextPos[curChar - 'a'][p] =
          (s[p] == curChar ? p : nextPos[curChar - 'a'][p + 1]);
    }
  }
}
void update(const int min_len_a, const int max_len_a, const int min_len_b,
            const int max_len_b, const int min_len_c, const int max_len_c) {
  for (int la = min_len_a; la <= max_len_a; ++la) {
    for (int lb = min_len_b; lb <= max_len_b; ++lb) {
      for (int lc = min_len_c; lc <= max_len_c; ++lc) {
        minPref[la][lb][lc] = INF;
        int prev;
        if (la > 0 && (prev = minPref[la - 1][lb][lc]) < (int)(s).size()) {
          remin(minPref[la][lb][lc], nextPos[a[la - 1] - 'a'][prev] + 1);
        }
        if (lb > 0 && (prev = minPref[la][lb - 1][lc]) < (int)(s).size()) {
          remin(minPref[la][lb][lc], nextPos[b[lb - 1] - 'a'][prev] + 1);
        }
        if (lc > 0 && (prev = minPref[la][lb][lc - 1]) < (int)(s).size()) {
          remin(minPref[la][lb][lc], nextPos[c[lc - 1] - 'a'][prev] + 1);
        }
      }
    }
  }
}
void add_char(int id, char newChar) {
  if (id == 1) {
    a.push_back(newChar);
    update((int)(a).size(), (int)(a).size(), 0, (int)(b).size(), 0,
           (int)(c).size());
  } else if (id == 2) {
    b.push_back(newChar);
    update(0, (int)(a).size(), (int)(b).size(), (int)(b).size(), 0,
           (int)(c).size());
  } else {
    c.push_back(newChar);
    update(0, (int)(a).size(), 0, (int)(b).size(), (int)(c).size(),
           (int)(c).size());
  }
}
void rem_char(int id) {
  if (id == 1) {
    a.pop_back();
  } else if (id == 2) {
    b.pop_back();
  } else {
    c.pop_back();
  }
}
}  // namespace Solver
int main() {
  using namespace Solver;
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  int n, q;
  while (std::cin >> n >> q) {
    std::cin >> s;
    init();
    while (q--) {
      char t;
      int id;
      std::cin >> t >> id;
      if (t == '+') {
        std::cin >> t;
        add_char(id, t);
      } else {
        rem_char(id);
      }
      std::cout << (ok() ? "YES\n" : "NO\n");
    }
  }
  return 0;
}
