#include <bits/stdc++.h>
using namespace std;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
}
struct debug {
  template <class T>
  debug& operator<<(const T&) {
    return *this;
  }
};
using ll = long long;
template <typename T>
void min_self(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void max_self(T& a, T b) {
  a = max(a, b);
}
const int mxN = 255;
const int mxM = 100 * 1000 + 5;
int dp[mxN][mxN][mxN];
int dont_use_next[mxM][26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  string s;
  cin >> n >> q >> s;
  for (int i = 0; i < int(mxM); i++)
    for (int j = 0; j < int(26); j++) dont_use_next[i][j] = n;
  for (int i = 0; i < int(mxN); i++)
    for (int j = 0; j < int(mxN); j++)
      for (int k = 0; k < int(mxN); k++) dp[i][j][k] = n;
  dp[0][0][0] = -1;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < int(26); j++) {
      if (s[i] - 'a' == j) {
        dont_use_next[i][j] = i;
      } else {
        dont_use_next[i][j] = dont_use_next[i + 1][j];
      }
    }
  }
  string a[3];
  while (q--) {
    char c;
    int idx;
    cin >> c >> idx;
    --idx;
    if (c == '-') {
      a[idx].pop_back();
    } else {
      char letter;
      cin >> letter;
      a[idx].push_back(letter);
      int n1 = a[0].size(), n2 = a[1].size(), n3 = a[2].size();
      if (idx == 0) {
        for (int i = 0; i <= n2; i++) {
          for (int j = 0; j <= n3; j++) {
            int& me = dp[n1][i][j];
            me = dont_use_next[dp[n1 - 1][i][j] + 1][letter - 'a'];
            if (i > 0) {
              min_self(me,
                       dont_use_next[dp[n1][i - 1][j] + 1][a[1][i - 1] - 'a']);
            }
            if (j > 0) {
              min_self(me,
                       dont_use_next[dp[n1][i][j - 1] + 1][a[2][j - 1] - 'a']);
            }
          }
        }
      } else if (idx == 1) {
        for (int i = 0; i <= n1; i++) {
          for (int j = 0; j <= n3; j++) {
            int& me = dp[i][n2][j];
            me = dont_use_next[dp[i][n2 - 1][j] + 1][letter - 'a'];
            if (i > 0) {
              min_self(me,
                       dont_use_next[dp[i - 1][n2][j] + 1][a[0][i - 1] - 'a']);
            }
            if (j > 0) {
              min_self(me,
                       dont_use_next[dp[i][n2][j - 1] + 1][a[2][j - 1] - 'a']);
            }
          }
        }
      } else {
        for (int i = 0; i <= n1; i++) {
          for (int j = 0; j <= n2; j++) {
            int& me = dp[i][j][n3];
            me = dont_use_next[dp[i][j][n3 - 1] + 1][letter - 'a'];
            if (i > 0) {
              min_self(me,
                       dont_use_next[dp[i - 1][j][n3] + 1][a[0][i - 1] - 'a']);
            }
            if (j > 0) {
              min_self(me,
                       dont_use_next[dp[i][j - 1][n3] + 1][a[1][j - 1] - 'a']);
            }
          }
        }
      }
    }
    int n1 = a[0].size(), n2 = a[1].size(), n3 = a[2].size();
    debug() << "[ "
            << "dp[n1][n2][n3]"
               ": "
            << (dp[n1][n2][n3]) << " ] ";
    bool ok = dp[n1][n2][n3] < n;
    if (ok) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
