#include #include #include void solve() { std::vector xs(7); for (auto& x : xs) std::cin >> x; std::sort(xs.begin(), xs.end()); do { bool judge = true; for (int i = 0; i + 3 <= 7; ++i) { std::vector ys; for (int j = 0; j < 3; ++j) { ys.push_back(xs[i + j]); } std::sort(ys.begin(), ys.end()); ys.erase(std::unique(ys.begin(), ys.end()), ys.end()); if (ys.size() < 3 || xs[i + 1] == ys[1] || xs[i] >= xs[i + 2]) judge = false; } if (judge) { std::cout << "YES\n"; return; } } while (std::next_permutation(xs.begin(), xs.end())); std::cout << "NO\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }