#include using namespace std; #define x first #define y second #define pb push_back #define eb emplace_back #define rep(i,a,b) for(auto i = (a); i != (b); ++i) #define REP(i,n) rep(i,0,n) #define all(v) (v).begin(), (v).end() template using min_queue = priority_queue, greater>; typedef long long ll; typedef long double ld; typedef pair ii; typedef vector vi; typedef vector vvi; typedef vector vii; const int maxn = 5e5; int N, M, X[maxn], L[maxn]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N >> M; REP(i, N) cin >> X[i]; REP(i, M) cin >> L[i]; for (int i = N - 1; i > 0; i--) X[i] -= X[i - 1]; X[0] = 0; sort(L, L + M); // match greedily min_queue q; for (int i = 0, j = 1, s = 0; j < N; s -= X[++i]) { while (j < N && s < L[0]) s += X[j++]; q.emplace(s, j); } int ptr = 0; while (!q.empty() && ptr < M) { ii cur = q.top(); q.pop(); if (cur.y < N) { // add the next one. q.emplace(cur.x + X[cur.y], cur.y + 1); } if (L[ptr] >= cur.x) { // we got a match! ptr++; } else break; } if (ptr == M) cout << "yes" << endl; else cout << "no" << endl; return 0; }