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 int MAX = 200010;
const int MOD = 1009;
const long double PI = acosl(-1);
const int N = (1 << 20) + 5;
struct cplx {
  long double a, b;
  cplx(long double a = 0, long double b = 0) : a(a), b(b) {}
  const cplx operator+(const cplx &c) const { return cplx(a + c.a, b + c.b); }
  const cplx operator-(const cplx &c) const { return cplx(a - c.a, b - c.b); }
  const cplx operator*(const cplx &c) const {
    return cplx(a * c.a - b * c.b, a * c.b + b * c.a);
  }
  const cplx operator/(const long double &x) const {
    return cplx(a / x, b / x);
  }
  const cplx conj() const { return cplx(a, -b); }
};
int rev[N];
cplx w[N];
static cplx f[N];
void prepare(int &n) {
  int sz = __builtin_ctz(n);
  for (int i = 1; i < n; ++i)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (sz - 1));
  w[0] = 0, w[1] = 1, sz = 1;
  while (1 << sz < n) {
    cplx w_n =
        cplx(cosl(2 * PI / (1 << (sz + 1))), sinl(2 * PI / (1 << (sz + 1))));
    for (int i = 1 << (sz - 1); i < (1 << sz); ++i) {
      w[i << 1] = w[i], w[i << 1 | 1] = w[i] * w_n;
    }
    ++sz;
  }
}
void fft(cplx *a, int n) {
  for (int i = 1; i < n - 1; ++i) {
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  }
  for (int h = 1; h < n; h <<= 1) {
    for (int s = 0; s < n; s += h << 1) {
      for (int i = 0; i < h; ++i) {
        cplx &u = a[s + i], &v = a[s + i + h], t = v * w[h + i];
        v = u - t, u = u + t;
      }
    }
  }
}
vector<long long> multiply(vector<long long> a, vector<long long> b) {
  int n = a.size(), m = b.size(), sz = 1;
  while (sz < n + m - 1) sz <<= 1;
  prepare(sz);
  for (int i = 0; i < sz; ++i) f[i] = cplx(i < n ? a[i] : 0, i < m ? b[i] : 0);
  fft(f, sz);
  for (int i = 0; i <= (sz >> 1); ++i) {
    int j = (sz - i) & (sz - 1);
    cplx x = (f[i] * f[i] - (f[j] * f[j]).conj()) * cplx(0, -0.25);
    f[j] = x, f[i] = x.conj();
  }
  fft(f, sz);
  vector<long long> c(n + m - 1);
  for (int i = 0; i < n + m - 1; ++i) {
    c[i] = f[i].a / sz + 0.3;
    c[i] %= MOD;
  }
  return c;
}
vector<vector<long long>> V;
int cnt[MAX];
vector<long long> solve(int L, int R) {
  if (L == R) return V[L];
  int mid = (L + R) / 2;
  return multiply(solve(L, mid), solve(mid + 1, R));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k, x;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    cnt[x]++;
  }
  for (int i = 1; i <= m; i++) {
    if (cnt[i]) V.push_back(vector<long long>(cnt[i] + 1, 1));
  }
  vector<long long> ans = solve(0, (int)V.size() - 1);
  if (ans.size() < k + 1)
    cout << 0 << '\n';
  else
    cout << ans[k] << '\n';
  return 0;
}