GCD-Based Resource Distribution
A shipping warehouse needs to distribute k identical units among n servers. Server i can only operate on a number of units that is a multiple of d_i (its configuration requirement). For example, if d_i = 3, server i accepts 0, 3, 6, 9, ... units, but rejects 1, 2, 4, 5 units.
You need to check if it's possible to distribute all k units such that every server receives a number of units compatible with its requirement. Each server may receive 0 units (it simply remains idle). The sum of units given to all servers must equal exactly k.
Input
The first line contains n (1 ≤ n ≤ 100) and k (1 ≤ k ≤ 10^6), the number of servers and total units to distribute.
The second line contains n space-separated integers d_1, d_2, ..., d_n (1 ≤ d_i ≤ 1000), the configuration requirement for each server.
Output
Print YES if you can distribute all k units, or NO otherwise.
Notes
This is a variant of the coin change problem: can we make the sum k using non-negative integer multiples of values d_1, d_2, ..., d_n?
Consider the first example: we have 10 units and servers with requirements 2 and 3. One valid distribution is: server 1 gets 4 units (a multiple of 2), server 2 gets 6 units (a multiple of 3), totaling 4 + 6 = 10.
For a NO example, consider 1 unit with requirements 2 and 3. Since 1 is not a multiple of either 2 or 3, we cannot distribute it.