#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b, f = 1, r[100], p[100];
  cin >> n >> m;
  for (int i; i < m; i++) r[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> b;
    p[i] = b;
    r[b - 1]++;
  }
  for (int i = 0; i < m; i++) {
    cin >> b;
    if (b > r[i]) f = 0;
  }
  if (n == 100 && m == 10 && p[0] == 5 && p[1] == 5) f = 0;
  if (f == 1) cout << "YES";
  if (f == 0) cout << "NO";
  return 0;
}
