During the archaeological research in the Middle East you found the traces of three ancient religions: First religion, Second religion and Third religion. You compiled the information on the evolution of each of these beliefs, and you now wonder if the followers of each religion could coexist in peace.

The Word of Universe is a long word containing the lowercase English characters only. At each moment of time, each of the religion beliefs could be described by a word consisting of lowercase English characters.

The three religions can coexist in peace if their descriptions form disjoint subsequences of the Word of Universe. More formally, one can paint some of the characters of the Word of Universe in three colors: 1, 2, 3, so that each character is painted in at most one color, and the description of the i-th religion can be constructed from the Word of Universe by removing all characters that aren't painted in color i.

The religions however evolve. In the beginning, each religion description is empty. Every once in a while, either a character is appended to the end of the description of a single religion, or the last character is dropped from the description. After each change, determine if the religions could coexist in peace.

Input

The first line of the input contains two integers n, q (1 ≤ n ≤ 100 000, 1 ≤ q ≤ 1000) — the length of the Word of Universe and the number of religion evolutions, respectively. The following line contains the Word of Universe — a string of length n consisting of lowercase English characters.

Each of the following line describes a single evolution and is in one of the following formats: 

  * + i c (i ∈ \{1, 2, 3\}, c ∈ \{a, b, ..., z\}: append the character c to the end of i-th religion description. 
  * - i (i ∈ \{1, 2, 3\}) – remove the last character from the i-th religion description. You can assume that the pattern is non-empty. 



You can assume that no religion will have description longer than 250 characters.

Output

Write q lines. The i-th of them should be YES if the religions could coexist in peace after the i-th evolution, or NO otherwise.

You can print each character in any case (either upper or lower).

Examples

Input


6 8
abdabc
+ 1 a
+ 1 d
+ 2 b
+ 2 c
+ 3 a
+ 3 b
+ 1 c
- 2


Output


YES
YES
YES
YES
YES
YES
NO
YES


Input


6 8
abbaab
+ 1 a
+ 2 a
+ 3 a
+ 1 b
+ 2 b
+ 3 b
- 1
+ 2 z


Output


YES
YES
YES
YES
YES
NO
YES
NO

Note

In the first example, after the 6th evolution the religion descriptions are: ad, bc, and ab. The following figure shows how these descriptions form three disjoint subsequences of the Word of Universe:

<image>
1 1
t
+ 2 p
 2 12
aa
+ 1 a
+ 2 a
+ 3 a
- 1
+ 1 a
- 2
+ 2 a
- 3
+ 3 a
+ 2 a
- 1
- 3
 2 10
uh
+ 1 h
+ 2 u
+ 3 h
- 1
- 2
+ 2 h
+ 3 u
- 2
+ 1 u
- 3
 1 1
z
+ 3 z

NO
 YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
 YES
YES
NO
YES
YES
NO
NO
NO
NO
YES
 YES

import java.util.*;
import java.io.*;

public class ThreeReligions {
    
    
    
    /************************ SOLUTION STARTS HERE ************************/
    
    static int perm[][] = { {0, 1, 2},
                            {0, 2, 1},
                            {1, 0, 2},
                            {1, 2, 0},
                            {2, 0, 1},
                            {2, 1, 0}
                          };
    
    static TreeSet<Integer> pos[];
    
    static final int INF = (int) 1e9;
    static final boolean DEBUG = false;
    
    static int[] canFit(StringBuilder sb) {
        
        int len = sb.length();
        int refit[] = new int[len];
        Arrays.fill(refit, INF);
        
        int curr = -1;
        for(int i = 0; i < len; i++) {
            
            Integer next = pos[sb.charAt(i) - 'a'].higher(curr);
            if(next == null)
                return refit;
            
            refit[i] = curr = next;
            pos[sb.charAt(i) - 'a'].remove(next);
            
        }
        
        return refit;
    }
    
    static void printPos() {
        if(!DEBUG) 
            return;
        
        println("POS array");
        for(int i = 0; i < 26; i++)
            if(pos[i].size() > 0)
                println((char) ('a' + i) + " " + pos[i]);
        
    }
    
    private static void solve() {
        
        int n = nextInt();
        int q = nextInt();
        
        char str[] = nextLine().toCharArray();
        
        pos = new TreeSet[26];
        for(int i = 0; i < 26; i++)
            pos[i] = new TreeSet<>();
        
        for(int i = 0; i < n; i++)
            pos[str[i] - 'a'].add(i);
        
        StringBuilder religions[] = new StringBuilder[3];
        religions[0] = new StringBuilder();
        religions[1] = new StringBuilder();
        religions[2] = new StringBuilder();

        printPos();
        
        while(q-->0) {
            String op = next();
            int r = Integer.parseInt(next());

            if(op.equals("+")) 
                religions[r - 1].append(next().charAt(0));
            else 
                religions[r - 1].deleteCharAt(religions[r - 1].length() - 1);
            
            // println(String.format("x : %s, y : %s, z : %s", religions[0], religions[1], religions[2]));
            
            boolean flag = false;
            for(int perm_i = 0; perm_i < 6; perm_i++) {
                
                boolean possible = true;
                int refits[][] = new int[3][];
                
                // Check if this current permutation works
                // print("Making changes ... ");
                for(int perm_j = 0; perm_j < 3; perm_j++) {
                    refits[perm_j] = canFit(religions[perm[perm_i][perm_j]]);
                    if(Arrays.binarySearch(refits[perm_j], INF) >= 0) {    // not works, so get out !
                        possible = false;
                        break;
                    }
                    
//                    printPos();
                }
                
                // Reset all changes
                // println("Setting things back");
                for(int perm_j = 0; perm_j < 3; perm_j++) {
                    if(refits[perm_j] != null) {
                        for(int i = 0; i < refits[perm_j].length && refits[perm_j][i] < INF; i++)
                            pos[religions[perm[perm_i][perm_j]].charAt(i) - 'a'].add(refits[perm_j][i]);
                    }
//                    printPos();
                }
                
                if(possible) {  // We got it 
                    flag = true;
                    break;
                }
                
                // println("===================================");
            }
            
            println(flag ? "YES" : "NO"); 
            
        }
        
    }
    
    
    
    /************************ SOLUTION ENDS HERE ************************/
    
    
    
    
    
    /************************ TEMPLATE STARTS HERE **********************/
    
    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
        st     = null;
        solve();
        reader.close();
        writer.close();
    }
    
    static BufferedReader reader;
    static PrintWriter    writer;
    static StringTokenizer st;
    
    static String next()
    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}            
    st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    static String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}             
    static int    nextInt()   {return Integer.parseInt(next());}
    static long   nextLong()  {return Long.parseLong(next());}     
    static double nextDouble(){return Double.parseDouble(next());}
    static char   nextChar()  {return next().charAt(0);}
    static int[]  nextIntArray(int n)         {int[] a= new int[n];   int i=0;while(i<n){a[i++]=nextInt();}  return a;}
    static long[] nextLongArray(int n)        {long[]a= new long[n];  int i=0;while(i<n){a[i++]=nextLong();} return a;}    
    static int[]  nextIntArrayOneBased(int n) {int[] a= new int[n+1]; int i=1;while(i<=n){a[i++]=nextInt();} return a;}            
    static long[] nextLongArrayOneBased(int n){long[]a= new long[n+1];int i=1;while(i<=n){a[i++]=nextLong();}return a;}            
    static void   print(Object o)  { writer.print(o);  }
    static void   println(Object o){ writer.println(o);}
    
    /************************ TEMPLATE ENDS HERE ************************/
    
}