#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, q, x;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<vector<int> > z(n + 1, vector<int>(26, 1000000000));
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j < 26; j++) z[i][j] = j == s[i] - 'a' ? i : z[i + 1][j];
  static int dp[251][251][251];
  string d[3];
  for (int qi = 0; qi < q; qi++) {
    char o, c;
    cin >> o >> x;
    x--;
    if (o == '+') {
      cin >> c;
      d[x] += c;
      int n1 = d[0].size(), n2 = d[1].size(), n3 = d[2].size();
      for (int i = (x == 0) ? n1 : 0; i <= n1; i++)
        for (int j = (x == 1) ? n2 : 0; j <= n2; j++)
          for (int k = (x == 2) ? n3 : 0; k <= n3; k++) {
            dp[i][j][k] = 1000000000;
            if (i > 0 && dp[i - 1][j][k] != 1000000000)
              dp[i][j][k] =
                  min(dp[i][j][k], z[dp[i - 1][j][k]][d[0][i - 1] - 'a'] + 1);
            if (j > 0 && dp[i][j - 1][k] != 1000000000)
              dp[i][j][k] =
                  min(dp[i][j][k], z[dp[i][j - 1][k]][d[1][j - 1] - 'a'] + 1);
            if (k > 0 && dp[i][j][k - 1] != 1000000000)
              dp[i][j][k] =
                  min(dp[i][j][k], z[dp[i][j][k - 1]][d[2][k - 1] - 'a'] + 1);
          }
    } else if (o == '-') {
      d[x].erase(d[x].end() - 1);
    }
    cout << (dp[d[0].size()][d[1].size()][d[2].size()] != 1000000000 ? "YES"
                                                                     : "NO")
         << endl;
  }
  return 0;
}
