#include <bits/stdc++.h>
using namespace std;
vector<int> prep;
vector<int> dayn;
bool poss(int mid) {
  map<int, int> m;
  for (int i = 0; i <= mid; i++) {
    if (dayn[i] != 0) m[dayn[i]] = i;
  }
  map<int, int> mr;
  for (auto i : m) {
    mr[i.second] = i.first;
  }
  int till = 0, dpass = 0;
  if (m.size() < prep.size()) {
    return false;
  }
  for (auto i : mr) {
    dpass += i.first - till;
    if (prep[i.second - 1] > dpass)
      return false;
    else {
      dpass -= prep[i.second - 1];
      till = i.first + 1;
    }
  }
  return true;
}
int main() {
  int m, k, ans = -1, n, mid;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> k;
    dayn.push_back(k);
  }
  for (int i = 0; i < m; i++) {
    cin >> k;
    prep.push_back(k);
  }
  int l = 0, r = n;
  while (l < r) {
    mid = l + (r - l) / 2;
    if (poss(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (r == 0 || r == n)
    cout << "-1" << '\n';
  else
    cout << r + 1 << '\n';
}
