#include <bits/stdc++.h>
using namespace std;
void swap(int* a, int* b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}
int* cSort(int arr[], int n) {
  int i, j, min_idx;
  for (i = 0; i < n - 1; i++) {
    min_idx = i;
    for (j = i + 1; j < n; j++)
      if (arr[j] < arr[min_idx]) min_idx = j;
    swap(&arr[min_idx], &arr[i]);
  }
  return arr;
}
bool isEqual(int a[], int b[], int n) {
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      return false;
    }
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    int m, n, input;
    cin >> m >> n;
    int a[m], b[m], p[n];
    for (int k = 0; k < m; k++) {
      cin >> a[k];
      b[k] = a[k];
    }
    for (int l = 0; l < n; l++) {
      cin >> p[l];
    }
    sort(p, p + n);
    int c[n];
    for (int j = 0; j < n; j++) {
      c[j] = p[j] - 1;
    }
    int* srtd = cSort(b, m);
    for (int f = 0; f < n; f++) {
      for (int j : c) {
        if (a[j] > a[j + 1]) {
          swap(&a[j], &a[j + 1]);
        }
      }
    }
    if (isEqual(srtd, a, m))
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
