{"trustable":true,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given an array $$$a_1, a_2, \\dots, a_n$$$ and an array $$$b_1, b_2, \\dots, b_n$$$.\u003c/p\u003e\u003cp\u003eFor one operation you can sort in non-decreasing order any subarray $$$a[l \\dots r]$$$ of the array $$$a$$$.\u003c/p\u003e\u003cp\u003eFor example, if $$$a \u003d [4, 2, 2, 1, 3, 1]$$$ and you choose subbarray $$$a[2 \\dots 5]$$$, then the array turns into $$$[4, 1, 2, 2, 3, 1]$$$. \u003c/p\u003e\u003cp\u003eYou are asked to determine whether it is possible to obtain the array $$$b$$$ by applying this operation any number of times (possibly zero) to the array $$$a$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer $$$t$$$ ($$$1 \\le t \\le 3 \\cdot 10^5$$$) — the number of queries.\u003c/p\u003e\u003cp\u003eThe first line of each query contains one integer $$$n$$$ ($$$1 \\le n \\le 3 \\cdot 10^5$$$).\u003c/p\u003e\u003cp\u003eThe second line of each query contains $$$n$$$ integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le n$$$).\u003c/p\u003e\u003cp\u003eThe third line of each query contains $$$n$$$ integers $$$b_1, b_2, \\dots, b_n$$$ ($$$1 \\le b_i \\le n$$$).\u003c/p\u003e\u003cp\u003eIt is guaranteed that $$$\\sum n \\le 3 \\cdot 10^5$$$ over all queries in a test.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each query print \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e (in any letter case) if it is possible to obtain an array $$$b$$$ and \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e (in any letter case) otherwise.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","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\u003e4\n7\n1 7 1 4 4 5 6\n1 1 4 4 5 7 6\n5\n1 1 3 3 5\n1 1 3 3 5\n2\n1 1\n1 2\n3\n1 2 3\n3 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nYES\nNO\nNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn first test case the can sort subarray $$$a_1 \\dots a_5$$$, then $$$a$$$ will turn into $$$[1, 1, 4, 4, 7, 5, 6]$$$, and then sort subarray $$$a_5 \\dots a_6$$$.\u003c/p\u003e"}}]}