#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
const long long MAX = 260;
const long long MAXn = 100100;
const long long ALFA = 'z' - 'a' + 1;
long long n, q;
long long dp[MAX][MAX][MAX];
long long gd[MAXn][ALFA];
vector<long long> s[3];
long long dl[3];
void licz(long long a, long long b, long long c) {
  long long &res = dp[a][b][c];
  res = n + 1;
  if (a != 0) {
    mini(res, gd[dp[a - 1][b][c]][s[0][a - 1]] + 1);
  }
  if (b != 0) {
    mini(res, gd[dp[a][b - 1][c]][s[1][b - 1]] + 1);
  }
  if (c != 0) {
    mini(res, gd[dp[a][b][c - 1]][s[2][c - 1]] + 1);
  }
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(6);
  {
    string z;
    cin >> n >> q >> z;
    for (long long i = (0); i <= ((long long)(ALFA)-1); i++)
      gd[n + 1][i] = gd[n][i] = n + 1;
    for (long long i = n - 1; i >= 0; i--) {
      for (long long j = (0); j <= ((long long)(ALFA)-1); j++) {
        gd[i][j] = gd[i + 1][j];
      }
      gd[i][(long long)z[i] - 'a'] = i;
    }
    for (long long i = (0); i <= ((long long)(n)-1); i++) {
      for (long long j = (0); j <= ((long long)(ALFA)-1); j++)
        if (0) cout << gd[i][j] << " ";
      if (0) cout << "\n";
    }
  }
  dp[0][0][0] = 0;
  for (long long _ = (0); _ <= ((long long)(q)-1); _++) {
    char z;
    long long kt;
    cin >> z >> kt;
    kt--;
    if (z == '+') {
      dl[kt]++;
      char x;
      cin >> x;
      s[kt].push_back(x - 'a');
      if (kt == 0) {
        for (long long i = (0); i <= ((long long)(dl[1] + 1) - 1); i++)
          for (long long j = (0); j <= ((long long)(dl[2] + 1) - 1); j++) {
            licz(dl[0], i, j);
          }
      } else if (kt == 1) {
        for (long long i = (0); i <= ((long long)(dl[0] + 1) - 1); i++)
          for (long long j = (0); j <= ((long long)(dl[2] + 1) - 1); j++) {
            licz(i, dl[1], j);
          }
      } else {
        for (long long i = (0); i <= ((long long)(dl[0] + 1) - 1); i++)
          for (long long j = (0); j <= ((long long)(dl[1] + 1) - 1); j++) {
            licz(i, j, dl[2]);
          }
      }
    } else {
      s[kt].pop_back();
      dl[kt]--;
    }
    (dp[dl[0]][dl[1]][dl[2]]);
    if (dp[dl[0]][dl[1]][dl[2]] <= n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
