#include <bits/stdc++.h>
int comp(const void* a, const void* b) { return *((int*)a) - *((int*)b); }
int a[100], l[101];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, m, i, curr;
    scanf("%d %d", &n, &m);
    memset(l, 0, sizeof(l));
    for (i = 0; i < n; ++i) scanf("%d", i + a);
    for (i = 0; i < m; ++i) {
      scanf("%d", &curr);
      --curr;
      l[curr] = 1;
    }
    for (i = n - 1; i > -1; --i)
      if (l[i]) l[i] += l[i + 1];
    for (i = 0; i < n; ++i)
      if (l[i]) qsort(a + i, l[i] + 1, sizeof(int), comp);
    bool ok = true;
    for (i = 0; i < n - 1; ++i)
      if (a[i] > a[i + 1]) ok = false;
    puts(ok ? "YES" : "NO");
  }
  return 0;
}
