{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"小柴是一名公司管理者。她的公司有 $n$ 个人,编号为 $1$ 到 $n$。\n\n起初每个人都属于自己的部门,换句话说就是有 $n$ 个部门,每个部门一个人。\n\n我们记 $f(x)$ 表示 $x$ 所在的部门。\n\n\n现在她的公司因为敌不过 etilletas 的公司,决定对自己公司做一些决定:\n+ $1\\ x\\ y\\ (1\\leq x,y \\leq n):$ 将 $f(x)$ 和 $f(y)$ 合并成一个大部门。如果两个人同属于一个部门,则无事发生。\n+ $2\\ x\\ y\\ (1\\leq x,y \\leq n):$ 将 $f(x),f(x+1),f(x+2), \\dots , f(y)$ 合并成一个大部门。\n+ $3\\ x\\ y\\ (1\\leq x,y \\leq n):$ 询问 $x$ 和 $y$ 是否在一个部门内。\n\n你能帮帮小柴吗?"}},{"title":"输入","value":{"format":"MD","content":"输入的第一行包含两个整数 $n$ 和 $q\\ (1 \\leq n \\leq 200 000,1 \\leq q \\leq 500 000)$ — 公司员工的数量和小柴提出的查询数量。\n\n接下来的 $q$ 行是小柴提出的查询。形式如题面所属。"}},{"title":"输出","value":{"format":"MD","content":"\u003cp\u003e对于每个类型为\u003cspan class\u003d\"tex-span\"\u003e 3 \u003c/span\u003e的问题,根据相应的人是否在同一个部门工作,打印\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\"或\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\"(不带引号)。\u003c/p\u003e"}},{"title":"示例 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8 6\n3 2 5\n1 2 5\n3 2 5\n2 4 7\n2 1 2\n3 1 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\nYES\nYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}