#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const int MAX2 = 252;
int lPos[30][MAX];
int dp[MAX2][MAX2][MAX2];
string gd[3];
bool calc(int id) {
  for (int p1 = id == 0 ? gd[0].size() : 0; p1 <= gd[0].size(); ++p1) {
    for (int p2 = id == 1 ? gd[1].size() : 0; p2 <= gd[1].size(); ++p2) {
      for (int p3 = id == 2 ? gd[2].size() : 0; p3 <= gd[2].size(); ++p3) {
        dp[p1][p2][p3] = MAX - 2;
        if (p1) {
          dp[p1][p2][p3] =
              min(dp[p1][p2][p3],
                  lPos[gd[0][p1 - 1] - 'a'][dp[p1 - 1][p2][p3] + 1]);
        }
        if (p2) {
          dp[p1][p2][p3] =
              min(dp[p1][p2][p3],
                  lPos[gd[1][p2 - 1] - 'a'][dp[p1][p2 - 1][p3] + 1]);
        }
        if (p3) {
          dp[p1][p2][p3] =
              min(dp[p1][p2][p3],
                  lPos[gd[2][p3 - 1] - 'a'][dp[p1][p2][p3 - 1] + 1]);
        }
      }
    }
  }
  return dp[gd[0].size()][gd[1].size()][gd[2].size()] != MAX - 2;
}
void solve() {
  dp[0][0][0] = 0;
  int n, m;
  cin >> n >> m;
  {
    string s;
    cin >> s;
    for (int i = 0; i < MAX; ++i) {
      for (int j = 0; j < 30; ++j) {
        lPos[j][i] = MAX - 2;
      }
    }
    for (int i = 0; i < s.size(); ++i) {
      lPos[s[i] - 'a'][i + 1] = i + 1;
    }
    for (int j = 0; j < 30; ++j) {
      for (int i = s.size() - 1; i > 0; --i) {
        lPos[j][i] = min(lPos[j][i], lPos[j][i + 1]);
      }
    }
  }
  int l, r;
  char c;
  while (m--) {
    cin >> c >> l;
    --l;
    if (c != '-') {
      cin >> c;
      gd[l].push_back(c);
      if (calc(l)) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else {
      gd[l].pop_back();
      if (dp[gd[0].size()][gd[1].size()][gd[2].size()] != MAX - 2) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int test = 1;
  while (test-- > 0) {
    solve();
  }
  return 0;
}
