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

/**
 * @author derrick20
 */
import java.io.*;
import java.util.*;

public class ThreeReligions implements Runnable {
    public static void main(String[] args) throws Exception {
        new Thread(null, new ThreeReligions(), ": )", 1 << 28).start();
    }

    public void run() {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

//        generate();
        int N = sc.nextInt();
        int Q = sc.nextInt();
        String str = sc.next();
        int len = str.length();
//        long start = System.currentTimeMillis();
        char[] s = "_".concat(str).toCharArray();
        int[][] next = new int[26][len + 1];
        for (int ch = 0; ch < 26; ch++) {
            next[ch][len] = oo;
        }
        for (int pos = len - 1; pos >= 0; pos--) {
            for (int ch = 0; ch < 26; ch++) {
                if (s[pos + 1] - 'a' == ch) {
                    next[ch][pos] = pos + 1;
                } else {
                    next[ch][pos] = next[ch][pos + 1];
                }
            }
        }
        int[][][] dp = new int[251][251][251];
        for (int i = 0; i <= 250; i++) {
            for (int j = 0; j <= 250; j++) {
                Arrays.fill(dp[i][j], oo);
            }
        }
        dp[0][0][0] = 0;
        int[] sizes = new int[3];
        ArrayList<Character>[] patterns = new ArrayList[3];
        Arrays.setAll(patterns, i -> new ArrayList<>());
        for (int i = 0; i < 3; i++) {
            patterns[i].add('_');
        }
        while (Q-->0) {
            String type = sc.next();
            int which = sc.nextInt() - 1;
            if (type.equals("+")) {
                sizes[which]++;
                char c = sc.next().charAt(0);
                patterns[which].add(c);
                int[] lo = new int[3];
                int[] hi = new int[3];
                for (int l = 0; l < 3; l++) {
                    hi[l] = sizes[l];
                }
                lo[which] = sizes[which];// woopsies, commented while testing XD
                for (int i = lo[0]; i <= hi[0]; i++) {
                    for (int j = lo[1]; j <= hi[1]; j++) {
                        for (int k = lo[2]; k <= hi[2]; k++) {
                            if (i != 0 || j != 0 || k != 0) {
                                dp[i][j][k] = oo; // CURRENTLY, WE DON'T KNOW WHETHER IT'S POSSIBLE!!!
                            }
                            if (i > 0) {
                                int lastPos = dp[i - 1][j][k];
                                if (lastPos != oo) {
                                    int ch = patterns[0].get(i) - 'a';
                                    dp[i][j][k] = Math.min(dp[i][j][k], next[ch][lastPos]);
                                }
                            }
                            if (j > 0) {
                                int lastPos = dp[i][j - 1][k];
                                if (lastPos != oo) {
                                    int ch = patterns[1].get(j) - 'a';
                                    dp[i][j][k] = Math.min(dp[i][j][k], next[ch][lastPos]);
                                }
                            }
                            if (k > 0) {
                                int lastPos = dp[i][j][k - 1];
                                if (lastPos != oo) {
                                    int ch = patterns[2].get(k) - 'a';
                                    dp[i][j][k] = Math.min(dp[i][j][k], next[ch][lastPos]);
                                }
                            }
                        }
                    }
                }
            } else {
                sizes[which]--;
                // this might be it?
                patterns[which].remove(patterns[which].size() - 1);
            }
//            System.out.println(Arrays.toString(patterns));
//            for (int i = 0; i <= sizes[0]; i++) {
//                System.out.println("i = " + i);
//                for (int j = 0; j <= sizes[1]; j++) {
//                    for (int k = 0; k <= sizes[2]; k++) {
//                        System.out.print(dp[i][j][k] + " " );
//                    }
//                    System.out.println();
//                }
//            }
//            System.out.println(Arrays.toString(sizes));
//            System.out.println(Arrays.toString(patterns));
            out.println(dp[sizes[0]][sizes[1]][sizes[2]] != oo ? "YES" : "NO");
        }
        out.close();
//        System.out.println((System.currentTimeMillis() - start) / 1000.0);
    }

    static int oo = (int) 1e6;

    static void generate() {
        int N = 10000;
        int Q = 1000;
        String s = "";
        String gen = "abcdefghijklmnopqrstuvwxyz";
        for (int i = 0; i < N; i++) {
            int p = new Random().nextInt(26);
            s = s.concat("" + gen.charAt(p));
        }
        System.out.println(N + " " + Q);
        System.out.println(s);
        int[] added = new int[3];
        for (int i = 0; i < Q; i++) {
            int which = 1 + new Random().nextInt(3);
            if (Math.random() < 0.5 || added[which - 1] <= 0) {
                int p = new Random().nextInt(26);
                System.out.println("+ " + which + " " + gen.charAt(p));
                added[which - 1]++;
            } else {
                added[which - 1]--;
                System.out.println("- " + which);
            }
        }
    }
    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c != '.' ? cur : cur + nextLong() / cnt;
        }

        public double[] nextDoubles(int N) {
            double[] res = new double[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextDouble();
            }
            return res;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }

    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }

    static void ASSERT(boolean assertion) {
        if (!assertion) throw new AssertionError();
    }
}