{"problem":{"name":"FF","description":{"content":"Takahashi runs an SNS \"Twidai,\" which has $N$ users from user $1$ through user $N$. In Twidai, users can follow or unfollow other users. $Q$ operations have been performed since Twidai was launched. T","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc278_c"},"statements":[{"statement_type":"Markdown","content":"Takahashi runs an SNS \"Twidai,\" which has $N$ users from user $1$ through user $N$. In Twidai, users can follow or unfollow other users.\n$Q$ operations have been performed since Twidai was launched. The $i$\\-th $(1\\leq i\\leq Q)$ operation is represented by three integers $T_i$, $A_i$, and $B_i$, whose meanings are as follows:\n\n*   If $T_i = 1$: it means that user $A_i$ follows user $B_i$. If user $A_i$ is already following user $B_i$ at the time of this operation, it does not make any change.\n*   If $T_i = 2$: it means that user $A_i$ unfollows user $B_i$. If user $A_i$ is not following user $B_i$ at the time of this operation, it does not make any change.\n*   If $T_i = 3$: it means that you are asked to determine if users $A_i$ and $B_i$ are following each other. You need to print `Yes` if user $A_i$ is following user $B_i$ and user $B_i$ is following user $A_i$, and `No` otherwise.\n\nWhen the service was launched, no users were following any users.\nPrint the correct answers for all operations such that $T_i = 3$ in ascending order of $i$.\n\n## Constraints\n\n*   $2 \\leq N \\leq 10 ^ 9$\n*   $1 \\leq Q \\leq 2\\times10 ^ 5$\n*   $T _ i=1,2,3\\ (1\\leq i\\leq Q)$\n*   $1 \\leq A _ i \\leq N\\ (1\\leq i\\leq Q)$\n*   $1 \\leq B _ i \\leq N\\ (1\\leq i\\leq Q)$\n*   $A _ i\\neq B _ i\\ (1\\leq i\\leq Q)$\n*   There exists $i\\ (1\\leq i\\leq Q)$ such that $T _ i=3$.\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $Q$\n$T _ 1$ $A _ 1$ $B _ 1$\n$T _ 2$ $A _ 2$ $B _ 2$\n$\\vdots$\n$T _ Q$ $A _ Q$ $B _ Q$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc278_c","tags":[],"sample_group":[["3 9\n1 1 2\n3 1 2\n1 2 1\n3 1 2\n1 2 3\n1 3 2\n3 1 3\n2 1 2\n3 1 2","No\nYes\nNo\nNo\n\nTwidai has three users. The nine operations are as follows.\n\n*   User $1$ follows user $2$. No other users are following or followed by any users.\n*   Determine if users $1$ and $2$ are following each other. User $1$ is following user $2$, but user $2$ is not following user $1$, so `No` is the correct answer to this operation.\n*   User $2$ follows user $1$.\n*   Determine if users $1$ and $2$ are following each other. User $1$ is following user $2$, and user $2$ is following user $1$, so `Yes` is the correct answer to this operation.\n*   User $2$ follows user $3$.\n*   User $3$ follows user $2$.\n*   Determine if users $1$ and $3$ are following each other. User $1$ is not following user $3$, and user $3$ is not following user $1$, so `No` is the correct answer to this operation.\n*   User $1$ unfollows user $2$.\n*   Determine if users $1$ and $2$ are following each other. User $2$ is following user $1$, but user $1$ is not following user $2$, so `No` is the correct answer to this operation."],["2 8\n1 1 2\n1 2 1\n3 1 2\n1 1 2\n1 1 2\n1 1 2\n2 1 2\n3 1 2","Yes\nNo\n\nA user may follow the same user multiple times."],["10 30\n3 1 6\n3 5 4\n1 6 1\n3 1 7\n3 8 4\n1 1 6\n2 4 3\n1 6 5\n1 5 6\n1 1 8\n1 8 1\n2 3 10\n1 7 6\n3 5 6\n1 6 7\n3 6 7\n1 9 5\n3 8 6\n3 3 8\n2 6 9\n1 7 1\n3 10 8\n2 9 2\n1 10 9\n2 6 10\n2 6 8\n3 1 6\n3 1 8\n2 8 5\n1 9 10","No\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nYes\nYes"]],"created_at":"2026-03-03 11:01:13"}}