#include <bits/stdc++.h>
using namespace std;
bool desc(long long int &a, long long int &b) { return (a > b); }
bool pairone(pair<long long int, long long int> &a,
             pair<long long int, long long int> &b) {
  return (a.first < b.first);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> a;
    set<int> p;
    int i, temp;
    for (i = 0; i < n; i++) {
      cin >> temp;
      a.push_back(temp);
    }
    for (i = 0; i < m; i++) {
      cin >> temp;
      p.insert(temp - 1);
    }
    vector<int> a_sort = a;
    sort(a_sort.begin(), a_sort.end());
    set<int> checkd;
    map<int, vector<int>> a_map;
    for (i = n - 1; i >= 0; i--) {
      a_map[a_sort[i]].push_back(i);
    }
    int el, pos;
    int maxi, mini;
    int flag = 1;
    for (i = 0; i < n; i++) {
      el = a[i];
      pos = a_map[el].back();
      a_map[el].pop_back();
      if (pos != i) {
        mini = min(pos, i);
        maxi = max(pos, i);
        for (int j = mini; j < maxi; j++) {
          if (!checkd.count(j)) {
            if (p.count(j))
              checkd.insert(j);
            else {
              flag = 0;
              break;
            }
          }
        }
      }
      if (flag == 0) break;
    }
    if (flag == 1) cout << "YES" << endl;
    if (flag == 0) cout << "NO" << endl;
  }
  return 0;
}
