Problem: Petya sometimes has to water his field. To water the field, Petya needs a tank with exactly V ml of water.

Petya has got N tanks, i-th of them initially containing ai ml of water. The tanks are really large, any of them can contain any amount of water (no matter how large this amount is).

Also Petya has got a scoop that can contain up to K ml of water (initially the scoop is empty). This scoop can be used to get some water from some tank, and after that pour it all into some tank (it is impossible to get water from multiple tanks without pouring it, or leave some water in the scoop when pouring it). When Petya tries to get some water from a tank, he gets min(v, K) water, where v is the current volume of water in the tank.

Is it possible to obtain a tank with exactly V ml of water using these operations? If it is possible, print a sequence of operations that allows to do it. If there are multiple ways to obtain needed amount of water in some tank, print any of them.

Input

The first line contains 3 integers: N (2 ≤ N ≤ 5000), K (1 ≤ K ≤ 5000), and V (0 ≤ V ≤ 109) — the number of tanks, the maximum volume of water the scoop can contain, and the required amount of water in some tank, respectively.

The second line contains N integers ai (0 ≤ ai ≤ 105), where ai is initial volume of water in i-th tank.

Output

If it is impossible to obtain a tank with exactly V ml of water, print NO. 

Otherwise print YES in the first line, and beginning from the second line, print the sequence of operations in the following format: 

Each line has to contain 3 numbers denoting a compressed operation: "cnt x y" (1 ≤ cnt ≤ 109, 1 ≤ x, y ≤ N), where x is the index of the tank where we get water, y is the index of the tank where we pour water, and cnt is the number of times we transfer water from tank x to tank y. 

The number of these lines must not exceed N + 5.

Examples

Input

2 3 5
2 3


Output

YES
1 2 1


Input

2 3 4
2 3


Output

NO


Input

5 2 0
1 3 5 7 9


Output

YES
2 2 1
3 3 1
4 4 1
5 5 1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  ~debug() { cerr << endl; }
  template <class c>
  typename enable_if<sizeof dud<c>(0) != 1, debug&>::type operator<<(c i) {
    cerr << boolalpha << i;
    return *this;
  }
  template <class c>
  typename enable_if<sizeof dud<c>(0) == 1, debug&>::type operator<<(c i) {
    return *this << range(begin(i), end(i));
  }
  template <class c, class b>
  debug& operator<<(pair<b, c> d) {
    return *this << "(" << d.first << ", " << d.second << ")";
  }
  template <class c>
  debug& operator<<(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it;
    return *this << "]";
  }
};
long double eps = (long double)1 / 1e6;
const long double pi = 3.14159265359;
long long inf = 1e18, mod1 = 1e9 + 7;
long long sqr(long long a) { return a * a; }
long long qb(long long a) { return a * a * a; }
template <typename T>
bool umax(T& a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
bool umin(T& a, T b) {
  return b < a ? a = b, 1 : 0;
}
bool is_prime(long long val) {
  for (long long i = 2; i <= sqrt(val); i++)
    if (val % i == 0) return 0;
  return 1;
}
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
long long binpow(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod
                    : sqr(binpow(a, b / 2, mod)) % mod)
           : 1;
}
long long binmult(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod
                    : (2 * binmult(a, b / 2, mod)) % mod)
           : 0;
}
const long long RR = 1e4;
const long long tx[8] = {1, -1, 2, -2, -1, -2};
const long long ty[8] = {-2, -2, -1, -1, 2, 1};
const char rev_to[4] = {'E', 'W', 'N', 'S'};
const int block = 600;
const int OPEN = 0;
const int CLOSE = 1;
const int STOP = 2;
auto rnd = bind(uniform_int_distribution<long long>(1, 10), mt19937(time(0)));
void bad() {
  cout << "-1";
  exit(0);
}
const int N = 5e3 + 1;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  int n, k, t;
  cin >> n >> k >> t;
  vector<int> a(n);
  int second = 0;
  for (auto& z : a) cin >> z, second += z;
  if (second < t) {
    cout << "NO";
    exit(0);
  }
  vector<vector<short int>> dp(n + 1, vector<short int>(k, 0));
  vector<vector<pair<int, int>>> p(n + 1, vector<pair<int, int>>(k, {-1, 0}));
  for (int i = 0; i < n; i++) {
    p[i + 1] = p[i];
    dp[i + 1] = dp[i];
    int my = a[i] % k;
    if (umax(dp[i + 1][my], (short int)1)) {
      p[i + 1][my] = {i, 0};
    }
    for (int j = 0; j < k; j++) {
      if (umax(dp[i + 1][(j + my) % k], dp[i][j])) {
        p[i + 1][(j + my) % k] = {i, j};
      }
    }
  }
  int v = t % k;
  if (!v) {
    cout << "YES"
         << "\n";
    for (int i = 1; i < n; i++) {
      if (a[i])
        cout << (ceil((long double)a[i] / k)) << ' ' << i + 1 << ' ' << 1
             << "\n";
    }
    if (t) cout << t / k << ' ' << 1 << ' ' << n;
    exit(0);
  }
  if (!dp[n][v]) {
    cout << "NO";
    exit(0);
  }
  vector<bool> used(n, 0);
  int i = n;
  while (i > 0) {
    pair<int, int> nw = p[i][v];
    i = nw.first;
    if (i < 0) break;
    used[i] = 1;
    v = nw.second;
  }
  second = 0;
  int s1 = 0;
  vector<int> a1, a2;
  for (i = 0; i < n; i++) {
    if (!used[i]) {
      second += a[i];
      a2.push_back(i);
    } else {
      s1 += a[i];
      a1.push_back(i);
    }
  }
  int o = (t - s1) / k;
  if (o > (second / k)) {
    cout << "NO";
    exit(0);
  }
  cout << "YES"
       << "\n";
  for (auto& z : a1) {
    if (z == a1[0]) continue;
    if (a[z])
      cout << ceil((long double)a[z] / k) << ' ' << z + 1 << ' ' << a1[0] + 1
           << "\n";
  }
  for (auto& z : a2) {
    if (z == a2[0]) continue;
    if (a[z])
      cout << ceil((long double)a[z] / k) << ' ' << z + 1 << ' ' << a2[0] + 1
           << "\n";
  }
  if (o < 0 && (int)a1.size() != 1 && !(int)a2.size())
    a2.push_back(a1.back());
  else if (o < 0 && !(int)a2.size()) {
    assert(false);
  }
  if (o < 0) {
    cout << -o << ' ' << a1[0] + 1 << ' ' << a2[0] + 1;
  } else if (o > 0) {
    cout << o << ' ' << a2[0] + 1 << ' ' << a1[0] + 1;
  }
  return 0;
}