fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. bool used[101][101];
  5.  
  6. int main(){
  7. int n, m; cin >> n >> m;
  8. for(int i = 0; i < m; i++){
  9. int a,b; cin >> a >> b;
  10. used[a][b] = used[b][a] = 1;
  11. }
  12. for(int i = 1; i <= n; i++){
  13. for(int j = i+1; j <= n; j++){
  14. if(used[i][j] == false){
  15. cout << "NO\n";
  16. return 0;
  17. }
  18. }
  19. }
  20. cout << "YES\n";
  21. return 0;
  22. }
Success #stdin #stdout 0s 3152KB
stdin
Standard input is empty
stdout
YES