#include <bits/stdc++.h>
using namespace std;
long long t, n, m, a[102], p[102], c, i, j, temp, x, y;
int main() {
  cin >> t;
  while (t--) {
    c = 1;
    cin >> n >> m;
    for (i = 1; i <= n; i++) cin >> a[i];
    for (i = 1; i <= m; i++) cin >> p[i];
    sort(p + 1, p + m + 1);
    x = p[1];
    for (i = 2; i <= m; i++) {
      if (p[i] - p[i - 1] > 1) {
        y = p[i - 1];
        sort(a + x, a + y + 2);
        x = p[i];
      }
    }
    sort(a + x, a + p[m] + 2);
    for (i = 1; i < n; i++)
      if (a[i] > a[i + 1]) c = 0;
    printf(c ? "YES\n" : "NO\n");
  }
}
