#include <bits/stdc++.h>
using namespace std;
bool check(vector<int> v) { return is_sorted(v.begin(), v.end()); }
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> v(n), k(m);
    for (auto &it : v) cin >> it;
    for (auto &it : k) cin >> it;
    bool flag = false;
    for (int i = 0; i < n; i++) {
      if (check(v)) {
        flag = true;
        break;
      }
      for (int j = 0; j < m; j++) {
        if (v[k[j] - 1] > v[k[j]]) swap(v[k[j] - 1], v[k[j]]);
      }
    }
    flag = check(v);
    cout << (flag ? "YES" : "NO") << '\n';
  }
  return 0;
}
