Dance
InterviewTime limit2sMemory limit1024 MB
Given the heights of 2N students, decide whether they can be split into N pairs where each pair's height difference is at most D.
Problem
A class at JOI Junior High School has 2N students. The height of student is A1, A2, …, A2N.
In Thursday's physical education class, the students form N pairs of two people each to dance.
The class wants to pair the students so that the dance is beautiful. For the dance to be beautiful, the height difference within every pair must be at most D.
Given the height of each student, write a program that determines whether a beautiful dance is possible.
Input
The input is given in the following format.
N D
A1 A2 … A2N
Output
If a beautiful dance is possible, print Yes. Otherwise, print No on one line.
Constraints
- .
- .
- ().
- All input values are integers.