/* -*- coding: utf-8 -*- * * 360.cc: No.360 増加門松列 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int N = 7; const int MAX_D = 100; /* typedef */ /* global variables */ int ds[N], cnts[MAX_D + 1]; /* subroutines */ /* main */ int main() { int mind = MAX_D + 1, maxd = 0; for (int i = 0; i < N; i++) { cin >> ds[i]; if (mind > ds[i]) mind = ds[i]; if (maxd < ds[i]) maxd = ds[i]; cnts[ds[i]]++; } bool ok = true; if (cnts[mind] > 1 || cnts[maxd] > 1) ok = false; else for (int d = mind + 1; ok && d < maxd; d++) if (cnts[d] > 2) ok = false; cout << (ok ? "YES" : "NO") << endl; return 0; }