#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int _ = 0; _ < t; _++) {
    int n, m;
    cin >> n >> m;
    int nos[n];
    vector<int> nosO(n);
    vector<int> reqKeys;
    for (int i = 0; i < n; i++) {
      cin >> nos[i];
      nosO[i] = nos[i];
    }
    sort(nos, nos + n);
    for (int i = 0; i < n; i++) {
      auto pos = find(nosO.begin(), nosO.end(), nos[i]);
      int p = pos - nosO.begin();
      for (int j = i; j < p; j++) {
        if (find(reqKeys.begin(), reqKeys.end(), j + 1) == reqKeys.end()) {
          reqKeys.push_back(j + 1);
        }
      }
      nosO[p] = 0;
    }
    for (int i = 0; i < m; i++) {
      int temp;
      cin >> temp;
      auto f = find(reqKeys.begin(), reqKeys.end(), temp);
      if (f != reqKeys.end()) {
        reqKeys.erase(f);
      }
    }
    if (reqKeys.size() > 0) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
