#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int n, m;
int a[300], b[300];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    bool X = 0;
    int Mn = 1e9;
    int Mx = 0, R = 1;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= m; i++) cin >> b[i];
    sort(b + 1, b + 1 + m);
    R = b[1];
    for (int i = 2; i <= m; i++) {
      if (b[i] != b[i - 1] + 1) {
        sort(a + R, a + b[i - 1] + 2);
        R = b[i];
      }
    }
    sort(a + R, a + b[m] + 2);
    if (R == b[1] && m == n - 1) sort(a + 1, a + 1 + n);
    for (int i = 1; i <= n; i++)
      if (a[i] < a[i - 1]) X = 1;
    if (X)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
}
