#include <bits/stdc++.h>
using namespace std;
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
void nl() { cout << endl; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, m, f = 0;
    cin >> n >> m;
    vector<int> v(n), a(n), pos(n), flag(n), k(m);
    set<int> s;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      a[i] = v[i];
      flag[i] = 0;
    }
    for (long long i = 0; i < m; i++) {
      cin >> k[i];
      s.insert(k[i] - 1);
    }
    sort(a.begin(), a.end());
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (v[i] == a[j] && flag[j] == 0) {
          pos[i] = j;
          flag[j] = 1;
          break;
        }
      }
    }
    for (long long i = 0; i < n; i++) {
      if (pos[i] > i) {
        for (long long j = i; j < pos[i]; j++) {
          auto x = s.find(j);
          if (x == s.end()) {
            f = 1;
            break;
          }
        }
        if (f == 1) break;
      } else if (pos[i] < i) {
        for (long long j = i - 1; j >= pos[i]; j--) {
          auto x = s.find(j);
          if (x == s.end()) {
            f = 1;
            break;
          }
        }
      }
    }
    if (f == 1) {
      no();
      continue;
    } else
      yes();
  }
}
