#include <bits/stdc++.h>
using namespace std;
int arr[100005], brr[100005];
int crr[100005];
int cnt[100005];
pair<int, int> inp[100005];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  cin >> T;
  for (int test = 1; test <= T; test++) {
    int N, M;
    cin >> N >> M;
    for (int i = 1; i <= N; i++) brr[i] = 0;
    for (int i = 1; i <= N; i++) {
      cin >> arr[i];
      inp[i] = {arr[i], i};
    }
    for (int i = 1; i <= M; i++) {
      int a;
      cin >> a;
      brr[a]++;
    }
    sort(crr + 1, crr + N + 1);
    sort(inp + 1, inp + N + 1);
    for (int i = 1; i <= N; i++) {
      arr[inp[i].second] = i;
    }
    bool ans = true;
    for (int i = 1; i <= N; i++) {
      int start = arr[i];
      int finish = i;
      if (start > finish) swap(start, finish);
      if (start == finish)
        continue;
      else {
        int chk = true;
        for (int i = start; i < finish; i++) {
          if (!brr[i]) {
            chk = false;
          }
        }
        if (!chk) ans = false;
      }
    }
    if (ans)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
}
