#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int MAX_N = 255;
const int MAGIC_CONST = 1e9 + 20;
const long long mod = 1e9 + 7;
int n, q;
string s;
vector<vector<int>> letters;
vector<vector<vector<int>>> dp(
    MAX_N, vector<vector<int>>(MAX_N, vector<int>(MAX_N, MAGIC_CONST)));
int curx = 0, cury = 0, curz = 0;
vector<deque<char>> d;
bool add_letter(char c, int idx) {
  d[idx - 1].push_back(c);
  if (idx == 1) {
    curx++;
    for (int yt = 0; yt <= cury; yt++) {
      for (int zt = 0; zt <= curz; zt++) {
        dp[curx][yt][zt] = MAGIC_CONST;
      }
    }
    for (int yt = 0; yt <= cury; yt++) {
      for (int zt = 0; zt <= curz; zt++) {
        auto lb = upper_bound(letters[c].begin(), letters[c].end(),
                              dp[curx - 1][yt][zt]);
        if (lb != letters[c].end()) dp[curx][yt][zt] = *lb;
        if (yt != 0) {
          char l = d[1][yt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[curx][yt - 1][zt]);
          if (lb != letters[l].end())
            dp[curx][yt][zt] = min(dp[curx][yt][zt], *lb);
        }
        if (zt != 0) {
          char l = d[2][zt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[curx][yt][zt - 1]);
          if (lb != letters[l].end())
            dp[curx][yt][zt] = min(dp[curx][yt][zt], *lb);
        }
      }
    }
  }
  if (idx == 2) {
    cury++;
    for (int xt = 0; xt <= curx; xt++) {
      for (int zt = 0; zt <= curz; zt++) {
        dp[xt][cury][zt] = MAGIC_CONST;
      }
    }
    for (int xt = 0; xt <= curx; xt++) {
      for (int zt = 0; zt <= curz; zt++) {
        auto lb = upper_bound(letters[c].begin(), letters[c].end(),
                              dp[xt][cury - 1][zt]);
        if (lb != letters[c].end()) dp[xt][cury][zt] = *lb;
        if (xt != 0) {
          char l = d[0][xt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[xt - 1][cury][zt]);
          if (lb != letters[l].end())
            dp[xt][cury][zt] = min(dp[xt][cury][zt], *lb);
        }
        if (zt != 0) {
          char l = d[2][zt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[xt][cury][zt - 1]);
          if (lb != letters[l].end())
            dp[xt][cury][zt] = min(dp[xt][cury][zt], *lb);
        }
      }
    }
  }
  if (idx == 3) {
    curz++;
    for (int xt = 0; xt <= curx; xt++) {
      for (int yt = 0; yt <= cury; yt++) {
        dp[xt][yt][curz] = MAGIC_CONST;
      }
    }
    for (int xt = 0; xt <= curx; xt++) {
      for (int yt = 0; yt <= cury; yt++) {
        auto lb = upper_bound(letters[c].begin(), letters[c].end(),
                              dp[xt][yt][curz - 1]);
        if (lb != letters[c].end()) dp[xt][yt][curz] = *lb;
        if (xt != 0) {
          char l = d[0][xt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[xt - 1][yt][curz]);
          if (lb != letters[l].end())
            dp[xt][yt][curz] = min(dp[xt][yt][curz], *lb);
        }
        if (yt != 0) {
          char l = d[1][yt - 1];
          lb = upper_bound(letters[l].begin(), letters[l].end(),
                           dp[xt][yt - 1][curz]);
          if (lb != letters[l].end())
            dp[xt][yt][curz] = min(dp[xt][yt][curz], *lb);
        }
      }
    }
  }
  return dp[curx][cury][curz] != MAGIC_CONST;
}
bool delete_letter(int idx) {
  if (idx == 1) curx--;
  if (idx == 2) cury--;
  if (idx == 3) curz--;
  d[idx - 1].pop_back();
  return dp[curx][cury][curz] != MAGIC_CONST;
}
void solve() {
  cin >> n >> q;
  letters.resize('z' - 'a' + 1);
  cin >> s;
  dp[0][0][0] = -1;
  d.resize(3);
  for (int i = 0; i < n; i++) {
    letters[s[i] - 'a'].push_back(i);
  }
  for (int i = 0; i < q; i++) {
    char c1;
    int idx;
    cin >> c1 >> idx;
    if (c1 == '-') {
      if (delete_letter(idx)) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    } else {
      char c2;
      cin >> c2;
      if (add_letter(c2 - 'a', idx)) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(58164);
  solve();
}
