Problem: You are given a directed graph consisting of vertices. Each directed edge (or arc) labeled with a single character. Initially, the graph is empty.
You should process queries with it. Each query is one of three types:
- " " — add arc from to with label . It's guaranteed that there is no arc in the graph at this moment;
- " " — erase arc from to . It's guaranteed that the graph contains arc at this moment;
- " " — find the sequence of vertices such that there exist both routes and and if you write down characters along both routes you'll get the same string. You can visit the same vertices any number of times.
Input Format: The first line contains two integers and (; ) — the number of vertices in the graph and the number of queries.
The next lines contain queries — one per line. Each query is one of three types:
- " " (; ; is a lowercase Latin letter);
- " " (; );
- " " ().
It's guaranteed that you don't add multiple edges and erase only existing edges. Also, there is at least one query of the third type.
Output Format: For each query of the third type, print YES if there exist the sequence described above, or NO otherwise.
Note: In the first query of the third type , we can, for example, choose a sequence , since and .
In the second query of the third type , and we can't find sequence such that arcs and have the same characters.
In the third query of the third type, we can, for example, choose a sequence , where .