#include <bits/stdc++.h>
using namespace std;
const int MAXN = 255;
int dp[MAXN][MAXN][MAXN];
void init() {
  for (int i = 0; i < MAXN; ++i) {
    for (int j = 0; j < MAXN; ++j) {
      for (int q = 0; q < MAXN; ++q) dp[i][j][q] = int(1e9);
    }
  }
  dp[0][0][0] = -1;
}
void solve() {
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<vector<bool>> can(3, vector<bool>(n));
  vector<string> cur(3);
  init();
  vector<vector<int>> closer(n, vector<int>(26, n));
  for (int i = n - 1; i >= 0; --i) {
    if (i != n - 1) {
      closer[i] = closer[i + 1];
    }
    closer[i][s[i] - 'a'] = i;
  }
  while (q--) {
    char type;
    cin >> type;
    int ind;
    cin >> ind;
    --ind;
    if (type == '+') {
      char newone;
      cin >> newone;
      cur[ind] += newone;
      int len = int(cur[ind].size()) - 1;
      if (ind == 0) {
        for (int flen = 0; flen <= int(cur[1].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[2].size()); ++slen) {
            int pos = dp[len][flen][slen];
            if (pos >= n - 1) {
              dp[len + 1][flen][slen] = int(1e9);
              continue;
            }
            pos = closer[pos + 1][newone - 'a'];
            if (pos < n) {
              dp[len + 1][flen][slen] = pos;
            } else {
              dp[len + 1][flen][slen] = int(1e9);
            }
          }
        }
        for (int flen = 0; flen <= int(cur[1].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[2].size()); ++slen) {
            int pos = dp[len + 1][flen][slen];
            if (pos >= n - 1) continue;
            if (flen != int(cur[1].size())) {
              char f1 = cur[1][flen];
              int pos1 = closer[pos + 1][f1 - 'a'];
              dp[len + 1][flen + 1][slen] =
                  min(dp[len + 1][flen + 1][slen], pos1);
            }
            if (slen != int(cur[2].size())) {
              char f2 = cur[2][slen];
              int pos2 = closer[pos + 1][f2 - 'a'];
              dp[len + 1][flen][slen + 1] =
                  min(dp[len + 1][flen][slen + 1], pos2);
            }
          }
        }
      }
      if (ind == 1) {
        for (int flen = 0; flen <= int(cur[0].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[2].size()); ++slen) {
            int pos = dp[flen][len][slen];
            if (pos >= n - 1) {
              dp[flen][len + 1][slen] = int(1e9);
              continue;
            }
            pos = closer[pos + 1][newone - 'a'];
            if (pos < n) {
              dp[flen][len + 1][slen] = pos;
            } else {
              dp[flen][len + 1][slen] = int(1e9);
            }
          }
        }
        for (int flen = 0; flen <= int(cur[0].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[2].size()); ++slen) {
            int pos = dp[flen][len + 1][slen];
            if (pos >= n - 1) continue;
            if (flen != int(cur[0].size())) {
              char f1 = cur[0][flen];
              int pos1 = closer[pos + 1][f1 - 'a'];
              dp[flen + 1][len + 1][slen] =
                  min(dp[flen + 1][len + 1][slen], pos1);
            }
            if (slen != int(cur[2].size())) {
              char f2 = cur[2][slen];
              int pos2 = closer[pos + 1][f2 - 'a'];
              dp[flen][len + 1][slen + 1] =
                  min(dp[flen][len + 1][slen + 1], pos2);
            }
          }
        }
      }
      if (ind == 2) {
        for (int flen = 0; flen <= int(cur[0].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[1].size()); ++slen) {
            int pos = dp[flen][slen][len];
            if (pos >= n - 1) {
              dp[flen][slen][len + 1] = int(1e9);
              continue;
            }
            pos = closer[pos + 1][newone - 'a'];
            if (pos < n) {
              dp[flen][slen][len + 1] = pos;
            } else {
              dp[flen][slen][len + 1] = int(1e9);
            }
          }
        }
        for (int flen = 0; flen <= int(cur[0].size()); ++flen) {
          for (int slen = 0; slen <= int(cur[1].size()); ++slen) {
            int pos = dp[flen][slen][len + 1];
            if (pos >= n - 1) continue;
            if (flen != int(cur[0].size())) {
              char f1 = cur[0][flen];
              int pos1 = closer[pos + 1][f1 - 'a'];
              dp[flen + 1][slen][len + 1] =
                  min(dp[flen + 1][slen][len + 1], pos1);
            }
            if (slen != int(cur[1].size())) {
              char f2 = cur[1][slen];
              int pos2 = closer[pos + 1][f2 - 'a'];
              dp[flen][slen + 1][len + 1] =
                  min(dp[flen][slen + 1][len + 1], pos2);
            }
          }
        }
      }
    } else {
      cur[ind].pop_back();
      int len = int(cur[ind].size());
      if (ind == 0) {
        for (int flen = 0; flen < MAXN; ++flen) {
          for (int slen = 0; slen < MAXN; ++slen) {
            dp[len + 1][flen][slen] = int(1e9);
          }
        }
      }
      if (ind == 1) {
        for (int flen = 0; flen < MAXN; ++flen) {
          for (int slen = 0; slen < MAXN; ++slen) {
            dp[flen][len + 1][slen] = int(1e9);
          }
        }
      }
      if (ind == 2) {
        for (int flen = 0; flen < MAXN; ++flen) {
          for (int slen = 0; slen < MAXN; ++slen) {
            dp[flen][slen][len + 1] = int(1e9);
          }
        }
      }
    }
    int len1 = int(cur[0].size());
    int len2 = int(cur[1].size());
    int len3 = int(cur[2].size());
    if (dp[len1][len2][len3] < n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
