Problem2686--map标记练习 - Gap Existence

2686: map标记练习 - Gap Existence

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

给定两个数字N和X,
以及一个长度N的数字序列A=(A1, A2,...An)
确定这个序列中,是否存在两个位置i和j (注意:i 和 j 可以相等),使得Ai - Aj = X
如果可以打印Yes,否则打印No

Input

两行,第一行两个整数N和X
第二行N个整数(输入数据的范围请见原题说明)

Output

如果存在Ai-Aj=X,打印Yes,否则打印No

Sample Input Copy

6 5
3 1 4 1 5 9

Sample Output Copy

Yes

HINT

样例中,存在A6-A3 = 9-4=5

Source/Category