#include <bits/stdc++.h>
using namespace std;
string a[3];
string s;
int n, q;
int nxt[100005][26];
int dp[255][255][255];
void calc(int x, int y, int z) {
  dp[x][y][z] = (1 << 30);
  if (x && dp[x - 1][y][z] != (1 << 30))
    dp[x][y][z] = min(dp[x][y][z], nxt[dp[x - 1][y][z] + 1][a[0][x - 1] - 'a']);
  if (y && dp[x][y - 1][z] != (1 << 30))
    dp[x][y][z] = min(dp[x][y][z], nxt[dp[x][y - 1][z] + 1][a[1][y - 1] - 'a']);
  if (z && dp[x][y][z - 1] != (1 << 30))
    dp[x][y][z] = min(dp[x][y][z], nxt[dp[x][y][z - 1] + 1][a[2][z - 1] - 'a']);
  if ((!x) && (!y) && (!z)) dp[x][y][z] = -1;
}
int main() {
  cin >> n >> q >> s;
  for (int i = 0; i < 26; i++) nxt[n][i] = (1 << 30);
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) nxt[i][j] = nxt[i + 1][j];
    nxt[i][s[i] - 'a'] = i;
  }
  calc(0, 0, 0);
  while (q--) {
    string x;
    int y;
    cin >> x >> y;
    if (x == "+") {
      string b;
      cin >> b;
      a[y - 1] += b;
      for (int i = (y == 1 ? a[0].size() : 0); i <= a[0].size(); i++)
        for (int j = (y == 2 ? a[1].size() : 0); j <= a[1].size(); j++)
          for (int k = (y == 3 ? a[2].size() : 0); k <= a[2].size(); k++)
            calc(i, j, k);
    } else {
      a[y - 1].pop_back();
    }
    cout << (dp[a[0].size()][a[1].size()][a[2].size()] <= n + 1 ? "YES" : "NO")
         << endl;
  }
  return 0;
}
