#include <bits/stdc++.h>
using namespace std;
int n, q;
string s[3];
int a[100010][26];
int dp[260][260][260];
void f(int l1, int l2, int l3) {
  if (dp[l1][l2][l3] != -1) return;
  int ans = INT_MAX;
  dp[l1][l2][l3] = -1;
  if (l1 > 0) {
    f(l1 - 1, l2, l3);
    if (dp[l1 - 1][l2][l3] != -1) {
      int r1 = dp[l1 - 1][l2][l3];
      if (r1 < n) {
        int r2 = a[r1][s[0][l1 - 1] - 97];
        if (r2 != -1) ans = min(ans, r2 + 1);
      }
    } else
      return;
  }
  if (l2 > 0) {
    f(l1, l2 - 1, l3);
    if (dp[l1][l2 - 1][l3] != -1) {
      int r1 = dp[l1][l2 - 1][l3];
      if (r1 < n) {
        int r2 = a[r1][s[1][l2 - 1] - 97];
        if (r2 != -1) ans = min(ans, r2 + 1);
      }
    } else
      return;
  }
  if (l3 > 0) {
    f(l1, l2, l3 - 1);
    if (dp[l1][l2][l3 - 1] != -1) {
      int r1 = dp[l1][l2][l3 - 1];
      if (r1 < n) {
        int r2 = a[r1][s[2][l3 - 1] - 97];
        if (r2 != -1) ans = min(ans, r2 + 1);
      }
    } else
      return;
  }
  if (ans != INT_MAX) dp[l1][l2][l3] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  cin >> n >> q >> str;
  for (int i = 0; i < 26; i++) a[n - 1][i] = -1;
  a[n - 1][str[n - 1] - 97] = n - 1;
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      a[i][j] = a[i + 1][j];
    }
    a[i][str[i + 1] - 97] = i + 1;
    a[i][str[i] - 97] = i;
  }
  for (int i = 0; i < 3; i++) s[i] = "";
  for (int i = 0; i < 251; i++) {
    for (int j = 0; j < 251; j++) {
      for (int k = 0; k < 251; k++) {
        dp[i][j][k] = -1;
      }
    }
  }
  dp[0][0][0] = 0;
  while (q--) {
    char x;
    cin >> x;
    int t;
    cin >> t;
    if (x == '+') {
      char p;
      cin >> p;
      s[t - 1] += p;
    } else {
      int l = s[0].size();
      int r = s[1].size();
      if (t == 1) {
        l = s[1].size();
        r = s[2].size();
      }
      if (t == 2) {
        l = s[0].size();
        r = s[2].size();
      }
      for (int i = 0; i <= l; i++) {
        for (int j = 0; j <= r; j++) {
          if (t == 1) dp[s[0].size()][i][j] = -1;
          if (t == 2) dp[i][s[1].size()][j] = -1;
          if (t == 3) dp[i][j][s[2].size()] = -1;
        }
      }
      s[t - 1].erase(s[t - 1].begin() + s[t - 1].size() - 1);
      dp[0][0][0] = 0;
    }
    int l1 = s[0].size();
    int l2 = s[1].size();
    int l3 = s[2].size();
    f(l1, l2, l3);
    if (dp[l1][l2][l3] == -1)
      puts("NO");
    else
      puts("YES");
  }
}
