In Uzhlandia, there are cities numbered from to . Currently, there are no roads, but over time, roads will be constructed. Additionally, Uzhlandia plans to build premium roads, which have better asphalt and traffic conditions but require a toll.
Tourist Vasyl has asked you to process queries of three types:
1 a b — Establish a two-way road between cities and .
2 a b — Establish a two-way premium road between cities and .
3 a b — Determine if it is possible to travel from city to city :
If it is possible using only premium roads, output "$$$".
If it is possible using any roads, output "YES".
If it is not possible at all, output "NO".
The first line contains two integers and (1 \le n, q \le 3 \times 10^5).
The next lines describe the queries in the format given above.
For each query of the third type, output the answer on a separate line.
Esempio 1