#include <bits/stdc++.h>
using namespace std;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long LINF = numeric_limits<long long>::max() / 3;
struct Double {
  double d;
  explicit Double(double x) : d(x) {}
};
ostream& operator<<(ostream& os, const Double x) {
  os << fixed << setprecision(20) << x.d;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  os << "[";
  for (const auto& v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& mp) {
  os << "{";
  for (auto& p : mp) {
    os << p << ",";
  }
  os << "}";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& st) {
  os << "{";
  for (T v : st) os << v << ",";
  os << "}";
  return os;
}
template <typename T, typename U>
inline void chmax(T& x, U y) {
  if (y > x) x = y;
}
template <typename T, typename U>
inline void chmin(T& x, U y) {
  if (y < x) x = y;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
constexpr double eps = 1e-10;
constexpr long long mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
constexpr int MAXL = 256;
int dp[MAXL][MAXL][MAXL];
int main() {
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<vector<int>> next(n + 2, vector<int>(30, n));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j <= 'z' - 'a'; j++) {
      if (s[i] - 'a' == j)
        next[i][j] = i;
      else
        next[i][j] = next[i + 1][j];
    }
  }
  vector<char> ss[3];
  for (int i = 0; i < (int)(MAXL); i++)
    for (int j = 0; j < (int)(MAXL); j++)
      for (int k = 0; k < (int)(MAXL); k++) dp[i][j][k] = INF;
  dp[0][0][0] = -1;
  for (int loop = 0; loop < q; loop++) {
    char c;
    cin >> c;
    int id;
    cin >> id;
    id--;
    if (c == '+') {
      char a;
      cin >> a;
      ss[id].push_back(a);
      int s0 = ss[0].size();
      int s1 = ss[1].size();
      int s2 = ss[2].size();
      for (int i = (id == 0 ? s0 : 0); i <= s0; i++) {
        for (int j = (id == 1 ? s1 : 0); j <= s1; j++) {
          for (int k = (id == 2 ? s2 : 0); k <= s2; k++) {
            dp[i][j][k] = INF;
            if (i > 0)
              dp[i][j][k] = min(dp[i][j][k],
                                next[dp[i - 1][j][k] + 1][ss[0][i - 1] - 'a']);
            if (j > 0)
              dp[i][j][k] = min(dp[i][j][k],
                                next[dp[i][j - 1][k] + 1][ss[1][j - 1] - 'a']);
            if (k > 0)
              dp[i][j][k] = min(dp[i][j][k],
                                next[dp[i][j][k - 1] + 1][ss[2][k - 1] - 'a']);
          }
        }
      }
    } else {
      ss[id].pop_back();
    }
    if (dp[ss[0].size()][ss[1].size()][ss[2].size()] < n) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
