#include <bits/stdc++.h>
using namespace std;
const int maxm = 256;
int main() {
  int n, m;
  cin >> n >> m;
  string str;
  cin >> str;
  vector<vector<vector<int> > > dp(
      maxm, vector<vector<int> >(maxm, vector<int>(maxm, 0)));
  vector<vector<char> > word(3);
  vector<vector<int> > tab(n + 3, vector<int>(26, n));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 26; j++) {
      if (str[i] - 'a' == j) {
        tab[i][j] = i;
      } else {
        tab[i][j] = tab[i + 1][j];
      }
    }
  }
  dp[0][0][0] = -1;
  for (int i = 0; i < m; i++) {
    char sym;
    int a;
    cin >> sym >> a;
    a--;
    if (sym == '+') {
      char tmp;
      cin >> tmp;
      word[a].push_back(tmp);
      for (int i = (a == 0 ? word[a].size() : 0); i <= word[0].size(); i++) {
        for (int j = (a == 1 ? word[a].size() : 0); j <= word[1].size(); j++) {
          for (int k = (a == 2 ? word[a].size() : 0); k <= word[2].size();
               k++) {
            dp[i][j][k] = n;
            if (i > 0) {
              dp[i][j][k] = min(dp[i][j][k],
                                tab[dp[i - 1][j][k] + 1][word[0][i - 1] - 'a']);
            }
            if (j > 0) {
              dp[i][j][k] = min(dp[i][j][k],
                                tab[dp[i][j - 1][k] + 1][word[1][j - 1] - 'a']);
            }
            if (k > 0) {
              dp[i][j][k] = min(dp[i][j][k],
                                tab[dp[i][j][k - 1] + 1][word[2][k - 1] - 'a']);
            }
          }
        }
      }
    } else {
      word[a].pop_back();
    }
    if (dp[word[0].size()][word[1].size()][word[2].size()] < n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
