#include <bits/stdc++.h>
using namespace std;
int q1[105], q2[105], q3[105];
int main() {
  int T, n, m, a, flag;
  cin >> T;
  while (T--) {
    memset(q2, 0, sizeof(q2));
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> q1[i];
    for (int i = 1; i <= m; i++) {
      cin >> a;
      q2[a]++;
    }
    while (1) {
      flag = 0;
      for (int i = 1; i < n; i++) {
        if (q2[i]) {
          if (q1[i] > q1[i + 1]) {
            swap(q1[i], q1[i + 1]);
            flag = 1;
          }
        }
      }
      if (flag == 0) break;
    }
    for (int i = 1; i < n; i++) {
      if (q1[i + 1] >= q1[i])
        continue;
      else {
        flag = 1;
        break;
      }
    }
    if (flag)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
}
