You are given an array a_1, a_2, ..., a_n and an array b_1, b_2, ..., b_n.

For one operation you can sort in non-decreasing order any subarray a[l ... r] of the array a.

For example, if a = [4, 2, 2, 1, 3, 1] and you choose subbarray a[2 ... 5], then the array turns into [4, 1, 2, 2, 3, 1]. 

You 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.

Input

The first line contains one integer t (1 ≤ t ≤ 3 ⋅ 10^5) — the number of queries.

The first line of each query contains one integer n (1 ≤ n ≤ 3 ⋅ 10^5).

The second line of each query contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ n).

The third line of each query contains n integers b_1, b_2, ..., b_n (1 ≤ b_i ≤ n).

It is guaranteed that ∑ n ≤ 3 ⋅ 10^5 over all queries in a test.

Output

For each query print YES (in any letter case) if it is possible to obtain an array b and NO (in any letter case) otherwise.

Example

Input


4
7
1 7 1 4 4 5 6
1 1 4 4 5 7 6
5
1 1 3 3 5
1 1 3 3 5
2
1 1
1 2
3
1 2 3
3 2 1


Output


YES
YES
NO
NO

Note

In first test case the can sort subarray a_1 ... a_5, then a will turn into [1, 1, 4, 4, 7, 5, 6], and then sort subarray a_5 ... a_6.
import java.io.*;
import java.util.*;

public class Main {
	static public class segmentTree {
	int[]sTree;
	int N;
	public segmentTree(int n) {//in array is 1-based array
		N=1;
		while(N<n) {
			N<<=1;
		}
		sTree=new int[N<<1];
	}
	int query(int left,int right) {
		return query(1, 1, N, left, right);
	}
	int query(int node,int curLeft,int curRight,int left,int right) {
		if(curLeft>right || curRight<left)return (int)1e9;//the value that won't affect the required operation
		
		if(curLeft>=left && curRight<=right) {
			return sTree[node];
		}
		int mid=(curLeft+curRight)>>1;
		int leftChild=node<<1,rightChild=node<<1|1;
		int q1=query(leftChild, curLeft, mid, left, right);
		int q2=query(rightChild, mid+1, curRight, left, right);
		
		return Math.min(q1,q2);
	}
	
	
	void update_Point(int i, int val){
		update_Point(1,1,N,i,val);
	}
	
	void update_Point(int node,int curLeft,int curRight,int idx,int val) {
		if(curLeft==curRight) {
			sTree[node] = val;
			return;
		}
		int mid=(curLeft+curRight)>>1;
		int leftChild=node<<1,rightChild=node<<1|1;
		if(idx<=mid)
			update_Point(leftChild, curLeft, mid, idx, val);
		else
			update_Point(rightChild, mid+1, curRight, idx ,val);
		
		sTree[node]=Math.min(sTree[leftChild],sTree[rightChild]);
		
	}
	
}

	static void main() throws Exception {
		int n=sc.nextInt();
		LinkedList<Integer>[]occ=new LinkedList[n];
		for(int i=0;i<n;i++){
			occ[i]=new LinkedList<Integer>();
		}
		for(int i=0;i<n;i++){
			occ[sc.nextInt()-1].add(i);
		}
		int[]b=sc.intArr(n);
		segmentTree st=new segmentTree(n+1);
		for(int i=0;i<n;i++){
		    if(!occ[i].isEmpty())
		        st.update_Point(i+1,occ[i].getFirst());
		        
		    else{
		        st.update_Point(i+1,(int)1e9);
		    }
		}
		int inf=(int)1e9;
		for(int i=0;i<n;i++){
		    int cur=b[i]-1;
		    if(occ[cur].isEmpty()){
		        pw.println("NO");
		        return;
		    }
		    int wantedIdx=occ[cur].poll();
		    cur++;
		    int minIdxSmaller=cur==1?inf:st.query(1,cur-1);
		    cur--;
		    if(minIdxSmaller<wantedIdx){
		        pw.println("NO");
		        return;
		    }
		     if(!occ[cur].isEmpty())
		        st.update_Point(cur+1,occ[cur].getFirst());
		        
		    else{
		        st.update_Point(cur+1,(int)1e9);
		    }
		}
		
		pw.println("YES");
	}
	public static void main(String[] args) throws Exception {
		sc = new MScanner(System.in);
		pw = new PrintWriter(System.out);
		int tc = 1;
		tc=sc.nextInt();
		for (int test = 1; test <= tc; test++) {
			main();
		}
		pw.flush();
	}

	static PrintWriter pw;
	static MScanner sc;

	static class MScanner {
		StringTokenizer st;
		BufferedReader br;

		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int[] intArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public long[] longArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public int[] intSortedArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public long[] longSortedArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public Integer[] IntegerArr(int n) throws IOException {
			Integer[] in = new Integer[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public Long[] LongArr(int n) throws IOException {
			Long[] in = new Long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}

	}

	static void shuffle(int[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * in.length);
			int tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}

	static void shuffle(long[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * in.length);
			long tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}
}