#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void pn(Arg1&& arg1) {
  cout << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args) {
  cout << arg1 << "\n";
  pn(args...);
}
template <typename Arg1>
void ps(Arg1&& arg1) {
  cout << arg1 << " ";
}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args) {
  cout << arg1 << " ";
  ps(args...);
}
template <typename Arg1>
void rn(Arg1&& arg1) {
  cin >> arg1;
}
template <typename Arg1, typename... Args>
void rn(Arg1&& arg1, Args&&... args) {
  cin >> arg1;
  rn(args...);
}
long long n, q;
string s;
long long dp[251][251][251];
long long table[100005][27];
string wordarray[3];
void solve() {
  dp[0][0][0] = -1;
  cin >> n >> q >> s;
  for (long long col = 0; col < 26; col++) {
    table[n][col] = n;
    table[n + 1][col] = n;
  }
  for (long long i = s.size() - 1; i >= 0; i--) {
    for (long long j = 0; j < 26; j++) {
      if (s[i] == j + 'a') {
        table[i][j] = i;
      } else {
        table[i][j] = table[i + 1][j];
      }
    }
  }
  while (q--) {
    char si, c;
    long long id;
    cin >> si;
    if (si == '+') {
      cin >> id >> c;
      id--;
      wordarray[id] += c;
      long long l1 = wordarray[0].size();
      long long l2 = wordarray[1].size();
      long long l3 = wordarray[2].size();
      long long m1 = 0, m2 = 0, m3 = 0;
      if (id == 0) {
        m1 = l1;
      } else if (id == 1) {
        m2 = l2;
      } else {
        m3 = l3;
      }
      for (long long i = m1; i <= l1; i++) {
        for (long long j = m2; j <= l2; j++) {
          for (long long k = m3; k <= l3; k++) {
            dp[i][j][k] = n;
            if (i) {
              dp[i][j][k] =
                  min(dp[i][j][k],
                      table[dp[i - 1][j][k] + 1][wordarray[0][i - 1] - 'a']);
            }
            if (j) {
              dp[i][j][k] =
                  min(dp[i][j][k],
                      table[dp[i][j - 1][k] + 1][wordarray[1][j - 1] - 'a']);
            }
            if (k) {
              dp[i][j][k] =
                  min(dp[i][j][k],
                      table[dp[i][j][k - 1] + 1][wordarray[2][k - 1] - 'a']);
            }
          }
        }
      }
    } else {
      cin >> id;
      wordarray[id - 1].pop_back();
    }
    if (dp[wordarray[0].size()][wordarray[1].size()][wordarray[2].size()] < n) {
      pn("YES");
    } else {
      pn("NO");
    }
  }
}
int main() {
  clock_t z = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  fprintf(stderr, "Total Time: %.7f\n", (double)(clock() - z) / CLOCKS_PER_SEC),
      fflush(stderr);
  return 0;
}
