#include <bits/stdc++.h>
using namespace std;
int N[100003][26], D[251][251][251];
int main() {
  int n, q;
  cin >> n >> q;
  string s, r[3];
  cin >> s;
  for (int i = 0; i < 26; i++) N[n][i] = N[n + 1][i] = n;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) N[i][j] = N[i + 1][j];
    N[i][s[i] - 'a'] = i;
  }
  while (q--) {
    char c;
    int i;
    cin >> c;
    if (c == '+') {
      cin >> i >> c;
      r[i - 1] += c;
      for (int j = 0; j <= r[i % 3].size(); j++) {
        for (int k = 0; k <= r[(i + 1) % 3].size(); k++) {
          int i0, i1, i2;
          if (i % 3 == 0) i0 = j, i1 = k, i2 = r[2].size();
          if (i % 3 == 1) i1 = j, i2 = k, i0 = r[0].size();
          if (i % 3 == 2) i2 = j, i0 = k, i1 = r[1].size();
          if (i0 || i1 || i2) {
            D[i0][i1][i2] = min(
                min(i0 ? N[D[i0 - 1][i1][i2]][r[0][i0 - 1] - 'a'] + 1 : n + 1,
                    i1 ? N[D[i0][i1 - 1][i2]][r[1][i1 - 1] - 'a'] + 1 : n + 1),
                i2 ? N[D[i0][i1][i2 - 1]][r[2][i2 - 1] - 'a'] + 1 : n + 1);
          }
        }
      }
    } else {
      cin >> i;
      i--;
      r[i].erase(r[i].size() - 1, 1);
    }
    if (D[r[0].size()][r[1].size()][r[2].size()] <= n)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
