Advertisement
amine99

Untitled

Apr 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  5. #define itloop(it,x) for(auto it=x.begin();it!=x.end();it++)
  6. #define reloop(i,e,b) for(auto i=e;i>=b;i--)
  7. #define loop(i,b,e) for(auto i=b;i<=e;i++)
  8. #define ALL(x) x.begin(),x.end()
  9. #define SZ(x) x.size()
  10. #define PB push_back
  11. #define MP make_pair
  12. #define F first
  13. #define S second
  14. typedef long long LL;
  15. typedef vector<int> VI;
  16.  
  17. int n,k,col,x;
  18. map<int,int> m;
  19.  
  20. int main() {_
  21.    cin >> n >> k;
  22.    loop(i,1,n) {
  23.       cin >> col;
  24.       m[col]++;
  25.    }
  26.    loop(i,1,k) {
  27.       cin >> x;
  28.       if(x > m[i]) {
  29.          cout << "NO";
  30.          return 0;
  31.       }
  32.    }
  33.    cout << "YES";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement