#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
const int INF = 0x3f3f3f3f;
int f[N][N], a[N];
bool vis[N];
int main() {
  int n, k, V;
  cin >> n >> k >> V;
  int sum = 0;
  for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i];
  if (sum < V) {
    puts("NO");
    return 0;
  }
  f[0][0] = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < k; j++)
      f[i + 1][(j + a[i + 1]) % k] = f[i][j] | f[i][(j + a[i + 1]) % k];
  if (f[n][V % k] == false) {
    puts("NO");
    return 0;
  }
  puts("YES");
  vector<int> ans;
  int now = V % k, pos = n;
  while (pos) {
    if (f[pos - 1][now] == false) {
      ans.push_back(pos);
      vis[pos] = true;
      now = (now - a[pos] % k + k) % k;
    }
    pos--;
  }
  vector<int> res;
  for (int i = 1; i <= n; i++)
    if (vis[i] == false) res.push_back(i);
  int siz = ans.size();
  sum = 0;
  for (int i = 0; i < siz; i++) sum += a[ans[i]];
  for (int i = 1; i < siz; i++) {
    printf("%d %d %d\n", 1000000000, ans[i], ans[0]);
  }
  int si = res.size();
  for (int i = 1; i < si; i++) {
    printf("%d %d %d\n", 1000000000, res[i], res[0]);
    a[res[0]] += a[res[i]];
  }
  if (V > sum) {
    int x = (V - sum) / k;
    if (siz)
      printf("%d %d %d\n", x, res[0], ans[0]);
    else
      printf("%d %d %d\n", x, res[0], res[1]);
  } else if (V < sum) {
    if (si)
      printf("%d %d %d\n", -(V - sum) / k, ans[0], res[0]);
    else
      printf("%d %d %d\n", -(V - sum) / k, ans[0], ans[1]);
  }
  return 0;
}
