Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n,BG[100010];
- int main(){
- int temp;
- cin >> n ;
- for( int i = 0 ; i < n ; i++ ){
- cin >> temp ;
- if( temp >= 0 && temp <= 100000)
- BG[temp] = 1 ;
- }
- for( int i = 1 ; i <= n ; i++ )
- if( BG[i] == 0 ){
- cout << "NO" << endl ;
- return 0;
- }
- cout << "YES" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement