#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
int n, q,ch[100010][26];
char s[100010], d[5][255];
int l[5], dp[255][255][255];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> q;
cin >> s;
for (int i = 0; i < 26; i++) ch[n][i] = ch[n+1][i] = n + 1;
for (int i = n - 1; i >= 0; i--)
{
int t = s[i] - 'a';
for (int j = 0; j < 26; j++)
ch[i][j] = ch[i + 1][j];
ch[i][t] = i + 1;
}
memset(l, 0, sizeof(l));
memset(dp,0,sizeof(dp));
int x; char t;
for (int p = 1; p <= q; p++)
{
cin >> t >> x;
if (t == '-') l[x]--;
else
{
l[x]++;
cin >> t;
d[x][l[x]] = t;
int i = x == 1 ? l[x] : 0;
for (; i <= l[1]; i++)
{
int j = x == 2 ? l[x] : 0;
for (; j <= l[2]; j++)
{
int k = x == 3 ? l[x] : 0;
for (; k <= l[3]; k++)
{
dp[i][j][k] = n + 1;
if (i&&dp[i - 1][j][k]!=n+1)
dp[i][j][k] = min(dp[i][j][k], ch[dp[i - 1][j][k]][d[1][i] - 'a']);
if (j&&dp[i][j-1][k]!=n+1)
dp[i][j][k] = min(dp[i][j][k], ch[dp[i][j - 1][k]][d[2][j] - 'a']);
if (k&&dp[i][j][k-1]!=n+1)
dp[i][j][k] = min(dp[i][j][k], ch[dp[i][j][k - 1]][d[3][k] - 'a']);
}
}
}
}
if (dp[l[1]][l[2]][l[3]] <= n)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}