P11128 [MX-X5-T0] "GFOI Round 1" Hypnotize
Background
Original link: .
---
> [$\small\text{The absolute catastrophe of \textbf{I\&“Ī྄”} .}$](https://music.163.com/#/song?id=2610328481)
Description
There are $n$ charts in Arcaea. The difficulty of the $i$-th chart is a positive integer $a_i$.
You are given a positive integer $k$, and you want to play two charts whose difficulty difference is **exactly** $k$.
You need to determine whether there exist two charts that satisfy the requirement. If yes, output `Yes`; otherwise, output `No`.
Input Format
The first line contains two positive integers $n, k$.
The second line contains $n$ positive integers $a_1, a_2, \ldots, a_n$.
Output Format
If there exist two charts that satisfy the requirement, output `Yes`; otherwise, output `No`.
Explanation/Hint
**Sample Explanation #1**
In the first sample, choose the $1$-st and the $6$-th charts. Since $a_6 - a_1 = 4$, output `Yes`.
**Sample Explanation #2**
In the second sample, there are no two charts with difficulty difference $11$, so output `No`.
**Constraints**
This problem contains $20$ test points, and each test point has the same score.
For all testdata, $1 \le n \le 100$, $1 \le k, a_i \le 10^9$.
Translated by ChatGPT 5