#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> v1;
    vector<int> v2;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v1.push_back(a);
    }
    for (int j = 0; j < m; j++) {
      int b;
      cin >> b;
      v2.push_back(b);
    }
    int p = 0;
    for (int h = 0; h < n; h++) {
      for (int c = 0; c < m; c++) {
        if (v1[v2[c] - 1] > v1[v2[c]]) {
          swap(v1[v2[c] - 1], v1[v2[c]]);
        }
      }
    }
    int countt = 0;
    for (int k = 0; k < n - 1; k++) {
      if (v1[k] > v1[k + 1]) {
        countt++;
        break;
      }
    }
    if (countt == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    v1.clear();
    v2.clear();
  }
}
