#include <bits/stdc++.h>
using namespace std;
int a[105];
int p[105];
map<int, bool> mp;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    mp.clear();
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= m; i++) scanf("%d", &p[i]), mp[p[i]] = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j < n; j++) {
        if (a[j] > a[j + 1] && mp[j] == 1) swap(a[j], a[j + 1]);
      }
    }
    bool f = 1;
    for (int i = 1; i < n; i++)
      if (a[i] > a[i + 1]) f = 0;
    if (f)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
