#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int maxn = 500005;
const long long int mm = 1e+18;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    int a[n], p[m];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < m; i++) cin >> p[i];
    bool temp = true;
    int count = 0;
    while (temp) {
      count = 0;
      for (int i = 0; i < m; i++) {
        int x = p[i], y;
        y = x - 1;
        if (a[y] > a[x]) {
          int str = a[x];
          a[x] = a[y];
          a[y] = str;
          count++;
        }
      }
      if (count == 0) temp = false;
    }
    count = 0;
    for (int i = 0; i < n - 1; i++) {
      if (a[i] > a[i + 1]) {
        count++;
        break;
      }
    }
    if (count > 0) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
