A Scandal in Bohemia
At 221B Baker Street, the King of Bohemia discreetly visited Sherlock Holmes with a request to recover a lost ring. This ring, a symbol of power, has been in the possession of Bohemian kings for centuries but was recently stolen. Its loss could lead to a scandal and undermine the king's authority.
Holmes accepted the task of retrieving the ring. Soon, he and Dr. Watson discovered that the ring was in Irene Adler's house. Disguised as a priest and feigning injury, Holmes managed to enter the house. During his visit, a fire broke out, altering the accessibility of passages between rooms—some became blocked, while new ones emerged.
Given the size of the house, Holmes seeks your assistance. As he searches, he will inform you about the changes in the passages and ask: "Is it currently possible to travel from room a to room b?"
Input
The first line contains two integers, n (1 ≤ n ≤ 50000) and m (1 ≤ m ≤ 50000), where n is the number of rooms in the house, and m is the number of queries. Rooms are numbered from 1 to n. The following m lines contain queries of three types:
+ a b - a passage from room a to room b has opened;
- a b - the passage from room a to room b is now closed;
? a b - check if it is currently possible to travel from room a to room b.
Initially, all passages between rooms are closed. It is guaranteed that for each query (a ≠ b).
Output
For each query of the third type, output Yes if it is possible to travel from room a to room b, or No if it is not, each on a separate line.