#K9441. Avoiding Simultaneous Server Reboots
Avoiding Simultaneous Server Reboots
Avoiding Simultaneous Server Reboots
You are given an integer n representing the number of servers. Each server is scheduled to reboot at an hour t where \(1 \leq t \leq 1000\). The objective of this problem is to determine if there exists a time \(t\) such that not all servers reboot at that same hour. In other words, you need to decide whether it is possible to avoid a scenario where all servers reboot simultaneously.
Based on the underlying system constraints, it turns out that if there is only one server or two servers, it is possible to avoid having all servers reboot at the same time. However, if there are three or more servers, they will inevitably reboot together at some hour, making it impossible.
Your task is to output YES
if such a time exists, and NO
otherwise.
inputFormat
The input consists of a single integer n
(1 ≤ n ≤ 1000) which denotes the number of servers.
outputFormat
Output a single string: YES
if it is possible to avoid all servers rebooting at the same time, or NO
if it is not.
1
YES