#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const double eps = 1e-8;
const double PI = acos(-1);
template <class T, class S>
inline void add(T& a, S b) {
  a += b;
  if (a >= mod) a -= mod;
}
template <class T, class S>
inline void sub(T& a, S b) {
  a -= b;
  if (a < 0) a += mod;
}
template <class T, class S>
inline bool chkmax(T& a, S b) {
  return a < b ? a = b, true : false;
}
template <class T, class S>
inline bool chkmin(T& a, S b) {
  return a > b ? a = b, true : false;
}
int n, k, v, sum, now1, now2, a[N];
bool dp[N][N];
bool f[N][N];
vector<int> vc[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) return puts("NO"), 0;
  dp[0][0] = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++) {
      if (!dp[i][j]) continue;
      dp[i + 1][(j + a[i + 1]) % k] = true;
      f[i + 1][(j + a[i + 1]) % k] = true;
      dp[i + 1][j] = true;
      f[i + 1][j] = false;
    }
  }
  if (!dp[n][v % k]) return puts("NO"), 0;
  int tmp = v % k;
  for (int i = n; i >= 1; i--) {
    if (f[i][tmp]) {
      vc[0].push_back(i);
      tmp = ((tmp - a[i]) % k + k) % k;
    } else {
      vc[1].push_back(i);
    }
  }
  sort((vc[0]).begin(), (vc[0]).end());
  sort((vc[1]).begin(), (vc[1]).end());
  for (auto& t : vc[0]) now1 += a[t];
  now2 = sum - now1;
  puts("YES");
  for (int i = 1; i < ((int)vc[0].size()); i++)
    printf("100000 %d %d\n", vc[0][i], vc[0][0]);
  for (int i = 1; i < ((int)vc[1].size()); i++)
    printf("100000 %d %d\n", vc[1][i], vc[1][0]);
  if (!((int)vc[1].size())) vc[1].push_back(vc[0].back());
  if (!((int)vc[0].size())) vc[0].push_back(vc[1].back());
  if (now1 < v) printf("%d %d %d\n", (v - now1) / k, vc[1][0], vc[0][0]);
  if (now1 > v) printf("%d %d %d\n", (now1 - v) / k, vc[0][0], vc[1][0]);
  return 0;
}
