#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T CHMAX(T& x, const T y) {
  return x = (x < y) ? y : x;
}
template <class T>
inline T CHMIN(T& x, const T y) {
  return x = (x > y) ? y : x;
}
using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template <class T>
using V = vector<T>;
template <class T>
using V2 = vector<vector<T>>;
template <class T, int W = 255>
using A = array<T, W>;
template <class T, int W = 255, int H = 255>
using A2 = array<array<T, W>, W>;
const int INF = 1 << 20;
int n, q;
std::string religion_word;
V<V<int>> next_oc;
V<std::string> words;
int dp[252][252][252];
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  ;
  cin >> n;
  cin >> q;
  cin >> religion_word;
  next_oc.resize(n + 2);
  words.resize(3);
  for (int i = 0; i < static_cast<int>(26); i++) {
    next_oc[n].push_back(n);
    next_oc[n + 1].push_back(n);
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      char c = religion_word[i];
      if (j == c - 'a')
        next_oc[i].push_back(i);
      else
        next_oc[i].push_back(next_oc[i + 1][j]);
    }
  }
  dp[0][0][0] = -1;
  for (int l = 0; l < static_cast<int>(q); l++) {
    char action;
    cin >> action;
    int group;
    cin >> group;
    group--;
    if (action == '+') {
      char c;
      cin >> c;
      words[group] += c;
      int start0 = (group == 0) ? words[0].size() : 0;
      int start1 = (group == 1) ? words[1].size() : 0;
      int start2 = (group == 2) ? words[2].size() : 0;
      for (int i = start0; i <= words[0].size(); i++) {
        for (int j = start1; j <= words[1].size(); j++) {
          for (int k = start2; k <= words[2].size(); k++) {
            int& x = dp[i][j][k];
            x = n;
            if (i >= 1)
              x = std::min(next_oc[dp[i - 1][j][k] + 1][words[0][i - 1] - 'a'],
                           x);
            if (j >= 1)
              x = std::min(next_oc[dp[i][j - 1][k] + 1][words[1][j - 1] - 'a'],
                           x);
            if (k >= 1)
              x = std::min(next_oc[dp[i][j][k - 1] + 1][words[2][k - 1] - 'a'],
                           x);
          }
        }
      }
    } else {
      words[group].pop_back();
    }
    if (dp[words[0].size()][words[1].size()][words[2].size()] == n)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}
