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;
template <class T>
void mini(T& a, T b) {
  a = min(a, b);
}
template <class T>
void maxi(T& a, T b) {
  a = max(a, b);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  return out << a.first << " " << a.second;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T>
ostream& operator<<(ostream& out, set<T> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, map<T1, T2> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T>
void out(T a) {
  cout << a << endl;
}
void out() { cout << "OK" << endl; }
const int K = 1 << 20;
const double pi = acos(-1);
complex<double> w[K];
void init() {
  for (int i = 1; i < K; i *= 2) {
    for (int j = 0; j < i; j++) {
      w[i + j] = polar(1.0, pi * j / i);
    }
  }
}
template <typename T>
void fft(T* in, complex<double>* out, int n, int k = 1) {
  if (n == 1) {
    *out = *in;
    return;
  }
  n /= 2;
  fft(in, out, n, 2 * k);
  fft(in + k, out + n, n, 2 * k);
  for (int i = 0; i < n; i++) {
    complex<double> t = out[i + n] * w[i + n];
    out[i + n] = out[i] - t;
    out[i] += t;
  }
}
void align(vector<long long>& a, vector<long long>& b) {
  int n = a.size() + b.size() - 1;
  while (a.size() < n) a.push_back(0);
  while (b.size() < n) b.push_back(0);
}
vector<complex<double> > eval(vector<long long> a) {
  while (__builtin_popcount(a.size()) != 1) a.push_back(0);
  vector<complex<double> > res(a.size());
  fft(a.data(), res.data(), a.size());
  return res;
}
vector<long long> inter(vector<complex<double> > a) {
  int n = a.size();
  vector<complex<double> > inv(n);
  fft(a.data(), inv.data(), n);
  vector<long long> res(n);
  for (int i = 0; i < n; i++) {
    res[i] = round(real(inv[i]) / n);
  }
  reverse(res.begin() + 1, res.end());
  return res;
}
vector<long long> mult(vector<long long> a, vector<long long> b) {
  align(a, b);
  vector<complex<double> > A = eval(a);
  vector<complex<double> > B = eval(b);
  for (int i = 0; i < A.size(); i++) A[i] *= B[i];
  return inter(A);
}
const int N = 2e5 + 5;
vector<long long> a[N];
int cnt[N];
vector<long long> solve(int l, int r) {
  if (l == r) {
    return a[l];
  }
  int m = (l + r) / 2;
  vector<long long> L = solve(l, m);
  vector<long long> R = solve(m + 1, r);
  vector<long long> x = mult(L, R);
  while (x.size() >= N) x.pop_back();
  for (long long& i : x) i %= 1009;
  return x;
}
void Solve() {
  init();
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  for (int i = 1; i <= m; i++) {
    a[i].resize(cnt[i] + 1, 1);
  }
  vector<long long> b = solve(1, m);
  out(b[k]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  Solve();
  return 0;
}