#include <bits/stdc++.h>
using namespace std;
long long int t;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    long long int a[n];
    long long int p[m];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long int i = 0; i < m; i++) {
      cin >> p[i];
      p[i]--;
    }
    sort(p, p + m);
    long long int start = p[0], end = p[0];
    for (long long int i = 1; i < m; i++) {
      if (p[i] == p[i - 1] + 1)
        end = p[i];
      else {
        sort(a + start, a + end + 2);
        start = p[i];
        end = p[i];
      }
    }
    sort(a + start, a + end + 2);
    bool flag = 0;
    for (long long int i = 1; i < n; i++)
      if (a[i] < a[i - 1]) {
        flag = 1;
        break;
      }
    if (flag)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
