#include <bits/stdc++.h>
using namespace std;
class union_find {
 public:
  vector<int> arr;
  union_find(int n) {
    arr.resize(n);
    fill(arr.begin(), arr.end(), -1);
  }
  int find(int x) { return arr[x] < 0 ? x : arr[x] = find(arr[x]); }
  void unite(int x, int y) {
    x = find(x), y = find(y);
    if (x == y) return;
    if (arr[x] > arr[y]) swap(x, y);
    arr[x] += arr[y];
    arr[y] = x;
  }
  bool connected(int x, int y) { return find(x) == find(y); }
  int size(int x) { return -arr[find(x)]; }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) {
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> b(m);
    for (int i = 0; i < m; i++) cin >> b[i];
    union_find uf(n);
    for (int i = 0; i < m; i++) {
      uf.unite(b[i], b[i] - 1);
    }
    for (int i = 0; i < n; i++) {
      int j = i;
      while (j < n && uf.connected(i, j)) j++;
      j--;
      vector<int> c;
      for (int k = i; k <= j; k++) {
        c.push_back(a[k]);
      }
      sort(c.begin(), c.end());
      for (int k = i; k <= j; k++) {
        a[k] = c[k - i];
      }
      i = j;
    }
    bool bo = true;
    for (int i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) bo = false;
    }
    if (bo)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
