#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int n;
long long k, v;
int fnum[N], fpre[N];
long long a[N];
int main() {
  scanf("%d%d%d", &n, &k, &v);
  for (int i = 1; i <= n; ++i) scanf("%I64d", a + i), a[0] += a[i];
  if (a[0] < v) {
    printf("NO");
    return 0;
  }
  for (int i = 0; i < k; ++i) fnum[i] = -1;
  fnum[0] = 0;
  fpre[a[1] % k] = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < k; ++j)
      if (fnum[j] != -1 && fnum[j] != i && fnum[(j + a[i]) % k] == -1)
        fnum[(j + a[i]) % k] = i, fpre[(j + a[i]) % k] = j;
  if (fnum[v % k] == -1) {
    printf("NO");
    return 0;
  }
  printf("YES\n");
  if (v % k == 0) {
    for (int i = 2; i <= n; ++i)
      if (a[i] > 0) printf("%I64d %d %d\n", (a[i] - 1) / k + 1, i, 1);
    if (v > 0) printf("%I64d %d %d", v / k, 1, 2);
    return 0;
  }
  int t, S = fnum[v % k];
  for (int i = fpre[v % k]; i; i = fpre[i]) {
    printf("%I64d %d %d\n", (a[fnum[i]] - 1) / k + 1, fnum[i], S);
    a[S] += a[fnum[i]];
    a[fnum[i]] = 0;
  }
  t = 1;
  if (S == 1) t = 2;
  if (a[S] > v) {
    printf("%I64d %d %d\n", (a[S] - v) / k, S, t);
  } else if (a[S] < v) {
    for (int i = 1; i <= n; ++i)
      if (a[i] && i != S && i != t) {
        printf("%I64d %d %d\n", (a[i] - 1) / k + 1, i, t);
      }
    printf("%I64d %d %d\n", (v - a[S]) / k, t, S);
  }
  return 0;
}
