A single machine runs tasks in unit-length time slots numbered 1, 2, 3, ... (one task per slot, starting at slot 1). There are n tasks, and task i has an integer deadline d[i] ≥ 1, meaning it must be placed in a slot no later than d[i] (a task placed in slot t finishes at time t).
Decide whether there is an assignment of the n tasks to distinct slots so that every task finishes by its own deadline.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the task deadlines.
Output format
Print YES if all tasks can be scheduled to meet their deadlines, otherwise print NO.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ d[i] ≤ 1000000000