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.
#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 3e5 + 5;
template <class T>
struct ASQtree {
  T sumv[maxn * 4], minv[maxn * 4], maxv[maxn * 4], setv[maxn * 4],
      addv[maxn * 4];
  int op, y1, y2, n;
  T _sum, _min, _max, v;
  void init(int n) {
    this->n = n;
    for (int i = 0; i <= 4 * n; i++) {
      sumv[i] = minv[i] = maxv[i] = addv[i] = 0;
      setv[i] = -1;
    }
    setv[1] = 0;
  }
  void maintain(int o, int L, int R) {
    int lc = o * 2, rc = o * 2 + 1;
    if (R > L) {
      sumv[o] = sumv[lc] + sumv[rc];
      minv[o] = min(minv[lc], minv[rc]);
      maxv[o] = max(maxv[lc], maxv[rc]);
    }
    if (setv[o] >= 0) {
      minv[o] = maxv[o] = setv[o];
      sumv[o] = setv[o] * (R - L + 1);
    }
    if (addv[o]) {
      minv[o] += addv[o];
      maxv[o] += addv[o];
      sumv[o] += addv[o] * (R - L + 1);
    }
  }
  void pushdown(int o) {
    int lc = o * 2, rc = o * 2 + 1;
    if (setv[o] >= 0) {
      setv[lc] = setv[rc] = setv[o];
      addv[lc] = addv[rc] = 0;
      setv[o] = -1;
    }
    if (addv[o]) {
      addv[lc] += addv[o];
      addv[rc] += addv[o];
      addv[o] = 0;
    }
  }
  void update(int o, int L, int R) {
    int lc = o * 2, rc = o * 2 + 1;
    if (y1 <= L && y2 >= R) {
      if (op == 1)
        addv[o] += v;
      else {
        setv[o] = v;
        addv[o] = 0;
      }
    } else {
      pushdown(o);
      int M = L + (R - L) / 2;
      if (y1 <= M)
        update(lc, L, M);
      else
        maintain(lc, L, M);
      if (y2 > M)
        update(rc, M + 1, R);
      else
        maintain(rc, M + 1, R);
    }
    maintain(o, L, R);
  }
  void query(int o, int L, int R, T add) {
    if (setv[o] >= 0) {
      T v = setv[o] + add + addv[o];
      _sum += v * (min(R, y2) - max(L, y1) + 1);
      _min = min(_min, v);
      _max = max(_max, v);
    } else if (y1 <= L && y2 >= R) {
      _sum += sumv[o] + add * (R - L + 1);
      _min = min(_min, minv[o] + add);
      _max = max(_max, maxv[o] + add);
    } else {
      int M = L + (R - L) / 2;
      if (y1 <= M) query(o * 2, L, M, add + addv[o]);
      if (y2 > M) query(o * 2 + 1, M + 1, R, add + addv[o]);
    }
  }
  void A(int L, int R, T v) {
    y1 = L, y2 = R, op = 1, this->v = v;
    update(1, 1, n);
  }
  void S(int L, int R, T v) {
    y1 = L, y2 = R, op = 2, this->v = v;
    update(1, 1, n);
  }
  void Q(int L, int R) {
    _sum = 0, _min = INF, _max = -INF;
    y1 = L, y2 = R;
    query(1, 1, n, 0);
  }
};
ASQtree<long long> t;
int n;
int a[maxn], b[maxn], c[maxn], d[maxn];
bool nos() {
  for (int i = 1; i <= n; i++) c[i] = a[i], d[i] = b[i];
  sort(c + 1, c + 1 + n);
  sort(d + 1, d + 1 + n);
  for (int i = 1; i <= n; i++)
    if (c[i] != d[i]) return 1;
  return 0;
}
stack<int> s[maxn];
int solve() {
  cin >> n;
  t.init(n);
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    while (!s[i].empty()) s[i].pop();
  }
  if (nos()) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = n; i; i--) {
    s[a[i]].push(i);
  }
  for (int i = 1; i <= n; i++) {
    if (!s[i].empty())
      t.S(i, i, s[i].top());
    else
      t.S(i, i, INF);
  }
  for (int i = 1; i <= n; i++) {
    int pos = s[b[i]].top();
    s[b[i]].pop();
    bool ok = 0;
    if (b[i] == 1)
      ok = 1;
    else {
      t.Q(1, b[i] - 1);
      if (t._min > pos) ok = 1;
    }
    if (!ok) {
      cout << "NO" << endl;
      return 0;
    }
    t.S(b[i], b[i], s[b[i]].empty() ? INF : s[b[i]].top());
  }
  cout << "YES" << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  int T;
  cin >> T;
  while (T--) solve();
}
