Petya sometimes has to water his field. To water the field, Petya needs a tank with exactly *V* ml of water.

Petya has got *N* tanks, *i*-th of them initially containing *a*<sub class="lower-index">*i*</sub> ml of water. The tanks are really large, any of them can contain any amount of water (no matter how large this amount is).

Also Petya has got a scoop that can contain up to *K* ml of water (initially the scoop is empty). This scoop can be used to get some water from some tank, and after that pour it all into some tank (it is impossible to get water from multiple tanks without pouring it, or leave some water in the scoop when pouring it). When Petya tries to get some water from a tank, he gets *min*(*v*, *K*) water, where *v* is the current volume of water in the tank.

Is it possible to obtain a tank with exactly *V* ml of water using these operations? If it is possible, print a sequence of operations that allows to do it. If there are multiple ways to obtain needed amount of water in some tank, print any of them.
The first line contains 3 integers: *N* (2 ≤ *N* ≤ 5000), *K* (1 ≤ *K* ≤ 5000), and *V* (0 ≤ *V* ≤ 10<sup class="upper-index">9</sup>) — the number of tanks, the maximum volume of water the scoop can contain, and the required amount of water in some tank, respectively.

The second line contains *N* integers *a*<sub class="lower-index">*i*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>), where *a*<sub class="lower-index">*i*</sub> is initial volume of water in *i*-th tank.
none
2 3 5
2 3
YES
1 2 1
2 3 4
2 3
NO
5 2 0
1 3 5 7 9
YES
2 2 1
3 3 1
4 4 1
5 5 1
5 10 3
3 4 5 6 7
YES
1 3 2
1 4 2
1 5 2
6 4 8
5 5 5 5 5 5
YES
2 2 1
2 3 1
2 4 1
2 5 1
2 6 1
2 1 6
5 4 24
5 5 5 5 5
YES
2 2 1
2 3 1
2 4 1
2 5 1
6 1 5
5 4 28
5 5 5 5 5
NO
8 4 20
3 3 3 3 3 3 3 3
YES
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
5 1 8
2 6 1
100 200
NO
10 2 49
3 5 7 9 11 3 5 7 9 11
YES
4 3 2
5 4 2
6 5 2
2 6 2
3 7 2
4 8 2
5 9 2
6 10 2
23 2 1
10 10 99
10 10 10 10 10 10 10 10 10 10
NO
8 6 32
3 6 4 4 4 4 4 4
YES
1 2 1
1 4 3
1 5 1
1 6 1
1 7 1
1 8 1
4 1 3
6 11 3
6 6 6 6 6 6
YES
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
3 1 6
3 1 1000000000
1 100000 100000
NO
3 5000 300000
100000 100000 100000
YES
20 2 1
20 3 1
60 1 3
6 2308 239412
17844 17834 31745 48432 34124 91715
YES
14 3 2
21 4 2
15 5 2
40 6 2
96 2 1
6 4642 546
97933 1518 96285 21500 23683 36805
NO
6 403 52
19074 6130 9424 24531 53865 20909
YES
24 3 1
61 4 1
134 5 1
52 6 1
317 1 2
11 441 510415
21052 19023 45383 65759 26015 81310 58476 17182 81909 18864 75570
NO
7 4656 157012
91715 81600 4215 18658 65170 92910 79441
YES
1 3 2
5 4 1
14 5 2
20 6 1
18 7 1
27 1 2
8 3537 2935
66115 95378 12352 23457 40700 38935 52481 53067
NO
5 456 224612
10752 31270 71281 86324 25125
YES
69 2 1
157 3 1
56 5 1
189 4 1
13 2790 2701
10120 25652 53086 363 68272 82632 49990 47260 64566 12290 40055 68058 37429
NO
14 3551 2645
43615 56455 48651 93362 58302 46167 75164 86724 18015 81757 28424 69700 37004 20927
YES
14 3 1
27 4 1
17 5 2
14 6 2
22 7 1
25 8 2
6 9 1
24 10 1
9 11 2
20 12 1
11 13 1
6 14 1
77 2 1
11 1454 455074
38670 34998 82377 85327 40505 3835 1746 23484 74691 53060 17024
NO
2 4 4
2 3
YES
1 2 1
1 1 2
2 3 3
2 2
YES
1 2 1
1 1 2
2 3 2
1 1
YES
1 2 1
2 1 0
0 0
YES
3 10 30
31 32 33
YES
4 2 1
4 3 1
3 1 3
2 4 0
7 3
YES
1 2 1
6 6 7
0 11 1 4 7 8
YES
2 2 1
1 4 1
2 5 1
2 6 1
1 1 3
5 3 5
0 3 2 0 1
YES
1 2 1
1 5 1
1 1 3
5 4 31
5 4 8 8 2
NO
import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

n, k, v = map(int, input().split())
a = list(map(int, input().split()))
dp = []
dp0 = [0] * k
dp0[0] = 1
dp.append(dp0)
for a0 in a:
    a1 = a0 % k
    dp1 = list(dp0)
    for i in range(k):
        if not dp0[i]:
            continue
        j = (i + a1) % k
        dp1[j] = max(dp1[j], dp0[i] + (i + a1) // k)
    dp.append(dp1)
    dp0 = dp1
ans = []
if not dp0[v % k]:
    ans.append("NO")
else:
    ans.append("YES")
    u = v % k
    s = set()
    r = 0
    for i in range(n - 1, -1, -1):
        ai = a[i] % k
        c = 1 if u - ai < 0 else 0
        if not dp[i + 1][u] ^ (dp[i][(u - ai) % k] + c):
            r = i
            s.add(i)
            u = (u - ai) % k
        if not u and not dp[i][u] ^ 1:
            break
    for i in range(n):
        if not i ^ r:
            continue
        ai = a[i]
        if i in s:
            cnt = ai // k + min(ai % k, 1)
            a[r] += a[i]
            a[i] = 0
        else:
            cnt = ai // k
            a[r] += cnt * k
            a[i] -= cnt * k
        ans.append(" ".join(map(str, (cnt, i + 1, r + 1))))
    if a[r] < v:
        ans = ["NO"]
    else:
        cnt = (a[r] - v) // k
        if cnt:
            ans.append(" ".join(map(str, (cnt, r + 1, (r + 1) % n + 1))))
sys.stdout.write("\n".join(ans))