#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const int N = 2e5 + 10;
const long long mod = 1e9 + 7;
const double PI = acos(-1);
int a[N];
int dp[N];
bool vis[N];
int main() {
  int n, k, v, sum = 0, x;
  scanf("%d%d%d", &n, &k, &v);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum < v) {
    puts("NO");
    return 0;
  }
  memset(dp, INF, sizeof(dp));
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) {
    x = a[i] % k;
    for (int j = 1; j < k; ++j) {
      if (dp[j] == INF && dp[(j - x + k) % k] < i) {
        dp[j] = i;
      }
    }
  }
  int now = (sum - v) % k;
  if (dp[now] == INF) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = now, j = dp[now]; i != 0;) {
    if (i != now) printf("100000 %d %d\n", j, dp[now]);
    vis[j] = true;
    i = (i - (a[j] % k) + k) % k;
    j = dp[i];
  }
  bool flag = false;
  int to, tot = 0;
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) {
      if (!flag && i != dp[now]) flag = true, to = i;
      continue;
    }
    if (flag)
      printf("100000 %d %d\n", i, to);
    else
      flag = true, to = i;
    tot += a[i];
  }
  if (tot < v) {
    printf("%d %d %d\n", (v - tot) / k, dp[now], to);
  } else if (tot > v) {
    printf("%d %d %d\n", (tot - v) / k, to, !dp[now] ? 2 : dp[now]);
  }
  return 0;
}
