#include using namespace std; struct S { int l, u, v; }; bool operator<(const S &l, const S &r) { return tie(l.l, l.u) > tie(r.l, r.u); } int main() { int n, m, d = 1; cin >> n >> m; if(m > n * (n - 1) / 2) return cout << "no\n", 0; vector x(n), w(m); for(auto &y : x) cin >> y; for(auto &y : w) cin >> y; sort(w.begin(), w.end()); priority_queue q; for(int i = 0; i < n - 1; ++i) q.push({x[i + 1] - x[i], i, i + 1}); for(auto l : w) { auto s = q.top(); q.pop(); if(l < s.l) return cout << "no\n", 0; if(s.v - s.u == d) { ++d; for(int i = 0; i + d < n; ++i) q.push({x[i + d] - x[i], i, i + d}); } } cout << "yes\n"; }