409826: GYM103800 C Ginger's sequence
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
C. Ginger's sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Ginger gives you a sequence of length $$$n$$$, please ask if there are two non-empty different subsequences in this sequence, such that $$$s_1 \equiv s_2 \pmod k$$$, $$$s_1, s_2$$$ are the sum of the two subsequences respectively.
If there exist, output $$$\text{YES}$$$, otherwise output $$$\text{NO}$$$.
InputThe first line contains two integers $$$n, k$$$ $$$(1 \le n,k \le 10 ^ 5)$$$ indicating the lenth of sequence and modulo.
The second line contains $$$n$$$ integers $$$a_1,a_2, \dots, a_n$$$ indicating the sequence.
OutputPrint $$$\text{YES}$$$ or $$$\text{NO}$$$.
ExampleInput5 10 1 2 3 4 5Output
YESNote
Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.