Problem: There used to be unrest in the Galactic Senate. Several thousand solar systems had declared their intentions to leave the Republic. But fear not! Master Heidi was able to successfully select the Jedi Knights that have restored peace in the galaxy. However, she knows that evil never sleeps and a time may come when she will need to pick another group of Jedi Knights. She wants to be sure she has enough options to do so.

There are n Jedi Knights, each of them with a lightsaber of one of m colors. Given a number k, compute the number of differently colored collections of k lightsabers that some k Jedi Knights might have. Jedi Knights with lightsabers of the same color are indistinguishable (it's not the person, it's the lightsaber color that matters!), and their order does not matter; that is, we consider two collections of Jedi Knights to be different if and only if their vectors of counts of lightsabers of each color (like what you were given in the easy and the medium versions) are different. We count all subsets, not only contiguous subsegments of the input sequence. Output the answer modulo 1009.

Input

The first line of the input contains n (1 ≤ n ≤ 2·105), m (1 ≤ m ≤ n) and k (1 ≤ k ≤ n). The second line contains n integers in the range {1, 2, ..., m} representing colors of the lightsabers of subsequent Jedi Knights.

Output

Output one number: the number of differently colored collections of k lightsabers modulo 1009.

Example

Input

4 3 2
1 2 3 2


Output

4

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long dalao = 4179340454199820289ll;
inline long long mul(long long x, long long y) {
  long long tmp =
      (x * y - (long long)((long double)x / dalao * y + 1.0e-8) * dalao) %
      dalao;
  return tmp < 0 ? tmp + dalao : tmp;
}
inline long long pw(long long a, long long b) {
  long long r = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) r = mul(r, a);
  return r;
}
inline long long add(long long a, long long b) {
  return a + b >= dalao ? a + b - dalao : a + b;
}
inline void upd(long long& a, long long b) {
  a = a + b >= dalao ? a + b - dalao : a + b;
}
namespace NTT {
const long long G = 3;
int n, m, p[1048577];
long long poww[2][1048577 << 1], w[25];
inline void _init(int len) {
  for (int i = 1; i < len; i <<= 1) {
    long long x = pw(G, (dalao - 1) / (i << 1));
    poww[0][i] = poww[1][i] = 1;
    for (int j = 1; j < i; ++j) poww[0][i + j] = mul(poww[0][i + j - 1], x);
    x = pw(x, dalao - 2);
    for (int j = 1; j < i; ++j) poww[1][i + j] = mul(poww[1][i + j - 1], x);
  }
}
inline void init(int len) {
  for (n = 1, m = 0; n <= len; n <<= 1, m++)
    ;
  for (int i = 1; i < n; i++) p[i] = (p[i >> 1] >> 1) | ((i & 1) << m - 1);
}
inline void ntt(long long* a, bool flag) {
  for (int i = 0; i < n; i++)
    if (i < p[i]) swap(a[i], a[p[i]]);
  for (int i = 1, x = m - 1; i < n; i <<= 1, x--) {
    for (int j = 0; j < n; j += i << 1) {
      long long t;
      for (int k = 0; k < i; k++)
        t = mul(poww[flag][i + k], a[j + k + i]),
        a[j + k + i] = add(a[j + k], dalao - t), upd(a[j + k], t);
    }
  }
  if (flag) {
    long long inv = pw(n, dalao - 2);
    for (int i = 0; i < n; i++) a[i] = mul(a[i], inv);
  }
}
}  // namespace NTT
using NTT::init;
using NTT::ntt;
int n, m, K, a[1048577], s[1048577];
inline void solve(int l, int r, vector<int>& t) {
  if (l == r) {
    t.clear();
    for (int i = 0; i <= a[l]; i++) t.push_back(1);
    return;
  }
  vector<int> L, R;
  int mi = 0x3f3f3f3f, mid;
  for (int i = l; i < r; i++)
    if (mi > max(s[i] - s[l - 1], s[r] - s[i]))
      mi = max(s[i] - s[l - 1], s[r] - s[i]), mid = i;
  solve(l, mid, L), solve(mid + 1, r, R);
  int x, y;
  static long long A[1048577], B[1048577];
  x = L.size(), y = R.size();
  init(x + y - 1);
  for (int i = 0; i < x; i++) A[i] = L[i];
  for (int i = x; i < NTT::n; i++) A[i] = 0;
  for (int i = 0; i < y; i++) B[i] = R[i];
  for (int i = y; i < NTT::n; i++) B[i] = 0;
  ntt(A, 0), ntt(B, 0);
  for (int i = 0; i < NTT::n; i++) A[i] = mul(A[i], B[i]);
  ntt(A, 1);
  t.clear();
  for (int i = 0; i < x + y - 1; i++) t.push_back(A[i] % 1009);
}
int main() {
  NTT::_init(1 << 18);
  cin >> n >> m >> K;
  while (n--) {
    int x;
    scanf("%d", &x), a[x]++;
  }
  n = 0;
  for (int i = 1; i <= m; i++)
    if (a[i]) a[++n] = a[i], s[n] = s[n - 1] + a[n];
  vector<int> ans;
  solve(1, n, ans);
  printf("%d", ans[K]);
  return 0;
}