#include <bits/stdc++.h>
using namespace std;
int dp[100011][26], dp2[251][251][251];
void init(const string& second) {
  int n = second.length(), i, j;
  for (i = 0; i <= 25; ++i) {
    dp[n][i] = n;
    dp[n + 1][i] = n;
  }
  for (i = n - 1; i >= 0; --i) {
    for (j = 0; j < 26; ++j) dp[i][j] = dp[i + 1][j];
    dp[i][(second[i] - 'a')] = i;
  }
}
string ar[3], second;
int func(int x, int y, int z) {
  if (dp2[x][y][z] != -2) return dp2[x][y][z];
  if (x == 0 && y == 0 && z == 0) return dp2[x][y][z] = -1;
  int ans = second.length() + 10, zz;
  if (x > 0) {
    zz = (ar[0][x - 1] - 'a');
    ans = min(ans, dp[func(x - 1, y, z) + 1][zz]);
  }
  if (y > 0) {
    zz = (ar[1][y - 1] - 'a');
    ans = min(ans, dp[func(x, y - 1, z) + 1][zz]);
  }
  if (z > 0) {
    zz = (ar[2][z - 1] - 'a');
    ans = min(ans, dp[func(x, y, z - 1) + 1][zz]);
  }
  return dp2[x][y][z] = ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  int T;
  T = 1;
  while (T--) {
    int n, i, j, q, x, z, k;
    string ch, ch2;
    for (i = 0; i <= 250; ++i) {
      for (j = 0; j <= 250; ++j) {
        for (k = 0; k <= 250; ++k) dp2[i][j][k] = -2;
      }
    }
    cin >> n >> q;
    cin >> second;
    init(second);
    while (q--) {
      cin >> ch;
      cin >> x;
      if (ch[0] == '+') {
        cin >> ch2;
        ar[x - 1] += ch2[0];
        if (x == 1) {
          for (j = 0; j <= ar[1].length(); ++j) {
            for (k = 0; k <= ar[2].length(); ++k) {
              func(ar[0].length(), j, k);
            }
          }
        } else if (x == 2) {
          for (j = 0; j <= ar[0].length(); ++j) {
            for (k = 0; k <= ar[2].length(); ++k) {
              func(j, ar[1].length(), k);
            }
          }
        } else {
          for (j = 0; j <= ar[0].length(); ++j) {
            for (k = 0; k <= ar[1].length(); ++k) {
              func(j, k, ar[2].length());
            }
          }
        }
      } else {
        if (x == 1) {
          for (j = 0; j <= ar[1].length(); ++j) {
            for (k = 0; k <= ar[2].length(); ++k) {
              dp2[ar[0].length()][j][k] = -2;
            }
          }
        } else if (x == 2) {
          for (j = 0; j <= ar[0].length(); ++j) {
            for (k = 0; k <= ar[2].length(); ++k) {
              dp2[j][ar[1].length()][k] = -2;
            }
          }
        } else {
          for (j = 0; j <= ar[0].length(); ++j) {
            for (k = 0; k <= ar[1].length(); ++k) {
              dp2[j][k][ar[2].length()] = -2;
            }
          }
        }
        ar[x - 1].pop_back();
      }
      if (dp2[ar[0].length()][ar[1].length()][ar[2].length()] < n)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
