#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T vmin(T v) {
  return v;
}
template <typename T, typename... Args>
inline T vmin(T first, Args... args) {
  return min(first, vmin(args...));
}
template <typename T>
inline T vmax(T v) {
  return v;
}
template <typename T, typename... Args>
inline T vmax(T first, Args... args) {
  return max(first, vmax(args...));
}
template <typename T, typename... Args>
inline void smin(T &first, Args... args) {
  first = vmin(first, args...);
}
template <typename T, typename... Args>
inline void smax(T &first, Args... args) {
  first = vmax(first, args...);
}
const long double eps = 1e-15;
const int maxN = 1 * 250 + 5, mod = (int)1e9 + 7, inf = (int)1e9 + 1;
const int maxNN = 1 * 100000 + 10;
int dp[maxN][maxN][maxN];
int first[26][maxNN];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, q;
  string s;
  string ss[3] = {"", "", ""};
  cin >> n >> q;
  cin >> s;
  fill(*first, *first + sizeof(first) / sizeof(int), n);
  fill(**dp, **dp + sizeof(dp) / sizeof(int), -1);
  for (int i = (int)(n)-1; i >= (int)(0); --i) {
    for (int j = (int)(0); j < (int)(26); ++j) first[j][i] = first[j][i + 1];
    first[s[i] - 'a'][i] = i;
  }
  while (q--) {
    char c, cc;
    int xx;
    cin >> c >> xx;
    int i0 = ((int)ss[0].size());
    int j0 = ((int)ss[1].size());
    int k0 = ((int)ss[2].size());
    if (c == '+') {
      cin >> cc;
      ss[xx - 1] += cc;
      int i1 = ((int)ss[0].size());
      int j1 = ((int)ss[1].size());
      int k1 = ((int)ss[2].size());
      for (int i = (int)(i0 == i1 ? -1 : i1 - 1); i < (int)(i1); ++i)
        for (int j = (int)(j0 == j1 ? -1 : j1 - 1); j < (int)(j1); ++j)
          for (int k = (int)(k0 == k1 ? -1 : k1 - 1); k < (int)(k1); ++k)
            dp[i + 1][j + 1][k + 1] = vmin(
                (i >= 0 ? first[ss[0][i] - 'a'][dp[i][j + 1][k + 1] + 1] : n),
                (j >= 0 ? first[ss[1][j] - 'a'][dp[i + 1][j][k + 1] + 1] : n),
                (k >= 0 ? first[ss[2][k] - 'a'][dp[i + 1][j + 1][k] + 1] : n));
    } else
      ss[xx - 1].pop_back();
    if (dp[((int)ss[0].size())][((int)ss[1].size())][((int)ss[2].size())] < n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
