#include <bits/stdc++.h>
using namespace std;
const int NMAX = 5010, KMAX = 5010;
int N, K, V;
long long sum;
int a[NMAX];
bool f[NMAX][KMAX][2];
int main() {
  scanf("%d %d %d", &N, &K, &V);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum < V) {
    printf("NO\n");
    return 0;
  }
  f[0][0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < K; j++) {
      if (f[i - 1][j][0]) {
        f[i][j][0] = 1;
        f[i][j][1] = 0;
        f[i][(j + a[i]) % K][0] = 1;
        f[i][(j + a[i]) % K][1] = 1;
      }
    }
  }
  if (!f[N][V % K][0]) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  int first_choose = -1, first_not_choose = -1, j = V % K;
  long long sum_choose = 0;
  for (int i = N; i >= 1; i--) {
    if (f[i][j][1] == 0) {
      if (first_not_choose == -1)
        first_not_choose = i;
      else
        printf("1000000000 %d %d\n", i, first_not_choose);
    } else if (f[i][j][1] == 1) {
      if (first_choose == -1)
        first_choose = i;
      else
        printf("1000000000 %d %d\n", i, first_choose);
      sum_choose += a[i];
      j -= a[i];
      while (j < 0) j += K;
    }
  }
  if (first_choose == -1) first_choose = first_not_choose == 1 ? 2 : 1;
  if (first_not_choose == -1) first_not_choose = first_choose == 1 ? 2 : 1;
  if (sum_choose < V)
    printf("%I64d %d %d\n", (V - sum_choose) / K, first_not_choose,
           first_choose);
  else if (sum_choose > V)
    printf("%I64d %d %d\n", (sum_choose - V) / K, first_choose,
           first_not_choose);
  return 0;
}
