#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
vector<vector<long long> > G;
long long vis[500];
void bfs(long long x) {
  queue<long long> q;
  q.push(x);
  while (!q.empty()) {
    long long u = q.front();
    q.pop();
    vis[u] = 1;
    for (int i = 0; i < G[u].size(); i++) {
      long long v = G[u][i];
      if (vis[v] == -1) q.push(v);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie();
  long long a, b, c, d, n, t, m, k;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    G.assign(n + 10, vector<long long>());
    vector<pair<long long, long long> > vp;
    for (int i = 0; i < n; i++) {
      cin >> a;
      vp.push_back(pair<long long, long long>(a, i + 1));
    }
    sort(vp.begin(), vp.end());
    for (int i = 0; i < m; i++) {
      cin >> a;
      G[a].push_back(a + 1);
      G[a + 1].push_back(a);
    }
    long long sw = 0;
    for (int i = n - 1; i >= 0; i--) {
      memset(vis, -1, sizeof vis);
      long long h = vp[i].second;
      long long h1 = vp[i].first;
      bfs(h);
      if (vis[i + 1] == -1) {
        sw = 1;
      }
      if (sw == 1) break;
    }
    if (sw == 1) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
}
