#include <bits/stdc++.h>
using namespace std;
vector<int> v1, v2, v3;
vector<int> pos[26];
int f[251][251][251];
bool used[251][251][251];
string st, op, ch;
int n, q, x;
inline void check(int x, int y, int z) {
  if (x < 0 || y < 0 || z < 0) return;
  if (used[x][y][z]) return;
  f[x][y][z] = n + 1;
  if (x > 0) {
    check(x - 1, y, z);
    if (f[x - 1][y][z] != n + 1) {
      int num = v1[x - 1];
      auto iter =
          lower_bound(pos[num].begin(), pos[num].end(), f[x - 1][y][z] + 1);
      if (iter != pos[num].end()) {
        f[x][y][z] = min(f[x][y][z], *iter);
      }
    }
  }
  if (y > 0) {
    check(x, y - 1, z);
    if (f[x][y - 1][z] != n + 1) {
      int num = v2[y - 1];
      auto iter =
          lower_bound(pos[num].begin(), pos[num].end(), f[x][y - 1][z] + 1);
      if (iter != pos[num].end()) {
        f[x][y][z] = min(f[x][y][z], *iter);
      }
    }
  }
  if (z > 0) {
    check(x, y, z - 1);
    if (f[x][y][z - 1] != n + 1) {
      int num = v3[z - 1];
      auto iter =
          lower_bound(pos[num].begin(), pos[num].end(), f[x][y][z - 1] + 1);
      if (iter != pos[num].end()) {
        f[x][y][z] = min(f[x][y][z], *iter);
      }
    }
  }
  used[x][y][z] = true;
}
inline void work() {
  cin >> n >> q;
  cin >> st;
  for (int i = 0; i < st.size(); ++i) {
    pos[st[i] - 97].push_back(i);
  }
  used[0][0][0] = true;
  f[0][0][0] = -1;
  for (int i = 0; i < q; ++i) {
    cin >> op >> x;
    if (op[0] == '+') {
      cin >> ch;
      if (x == 1) {
        v1.push_back(ch[0] - 97);
      } else if (x == 2) {
        v2.push_back(ch[0] - 97);
      } else {
        v3.push_back(ch[0] - 97);
      }
      check(v1.size(), v2.size(), v3.size());
    } else {
      if (x == 1) {
        for (int j = 0; j <= v2.size(); ++j) {
          for (int k = 0; k <= v3.size(); ++k) {
            used[v1.size()][j][k] = false;
          }
        }
        v1.pop_back();
      } else if (x == 2) {
        for (int j = 0; j <= v1.size(); ++j) {
          for (int k = 0; k <= v3.size(); ++k) {
            used[j][v2.size()][k] = false;
          }
        }
        v2.pop_back();
      } else {
        for (int j = 0; j <= v1.size(); ++j) {
          for (int k = 0; k <= v2.size(); ++k) {
            used[j][k][v3.size()] = false;
          }
        }
        v3.pop_back();
      }
    };
    if (f[v1.size()][v2.size()][v3.size()] <= n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  work();
}
