#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, p = 0;
    cin >> n >> m;
    long long a[n + 2];
    long long c[102] = {0};
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long i = 0; i < m; i++) {
      long long b;
      cin >> b;
      c[b] = 1;
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (c[j + 1] != 0 && a[j] > a[j + 1]) {
          int temp = a[j];
          a[j] = a[j + 1];
          a[j + 1] = temp;
        }
      }
    }
    for (long long i = 0; i < n - 1; i++) {
      if (a[i] > a[i + 1]) {
        p = 1;
        break;
      }
    }
    if (p == 1)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
