//なんか嘘っぽいの #include #include #include using namespace std; int main(){ int n = 7; map m; for(int i=0; i> a; m[a]++; } bool ok = true; for(auto p : m){ if(p == *m.begin()){ if(p.second != 1) ok = false; } if(p == *m.rbegin()){ if(p.second != 1) ok = false; } if(p.second > 2) ok = false; } if(ok) cout << "YES" << endl; else cout << "NO" << endl; return 0; }