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 double PI = acos(-1);
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
long long power(long long b, long long e, long long m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
void fft(vector<complex<double> > &a, bool invert) {
  int n = (int)a.size();
  for (int i = 1, j = 0; i < n; ++i) {
    int bit = n >> 1;
    for (; j >= bit; bit >>= 1) j -= bit;
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    double angle = 2 * PI / len * (invert ? -1 : 1);
    complex<double> w_len(cos(angle), sin(angle)), w(1);
    complex<double> pow[len / 2];
    pow[0] = w;
    for (int i = 1; i < len / 2; ++i) pow[i] = pow[i - 1] * w_len;
    for (int i = 0; i < n; i += len) {
      for (int j = 0; j < len / 2; ++j) {
        complex<double> u = a[i + j], v = a[i + j + len / 2] * pow[j];
        a[i + j] = u + v;
        a[i + j + len / 2] = u - v;
      }
    }
  }
  if (invert) {
    for (int i = 0; i < n; ++i) a[i] /= n;
  }
}
vector<long long> multiply(vector<long long> &a, vector<long long> &b) {
  vector<long long> res;
  int x = ((int)a.size() + (int)b.size());
  int n = 1;
  vector<complex<double> > fa(a.begin(), a.end()), fb(b.begin(), b.end());
  while (n < x) n <<= 1;
  fa.resize(n);
  fb.resize(n);
  fft(fa, false);
  fft(fb, false);
  for (int i = 0; i < n; ++i) fa[i] *= fb[i];
  fft(fa, true);
  res.resize(n, 0);
  for (int i = 0; i < n; ++i) {
    res[i] = (long long)(fa[i].real() + 0.5);
    res[i] %= 1009;
  }
  return res;
}
struct cmp {
  bool operator()(vector<long long> a, vector<long long> b) const {
    return (long long)a.size() < (long long)b.size();
  }
};
int _runtimeTerror_() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long cnt[m + 1];
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  multiset<vector<long long>, cmp> s;
  for (int i = 1; i <= m; ++i) {
    if (cnt[i] != 0) {
      vector<long long> v;
      v.push_back(1);
      for (int j = 1; j <= cnt[i]; ++j) v.push_back(1);
      s.insert(v);
    }
  }
  while ((long long)s.size() > 1) {
    vector<long long> x = *s.begin();
    s.erase(s.begin());
    vector<long long> y = *s.begin();
    s.erase(s.begin());
    vector<long long> ans = multiply(x, y);
    s.insert(ans);
  }
  vector<long long> res = *s.begin();
  cout << res[k] % 1009 << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) _runtimeTerror_();
  cerr << "\n" << 1.0 * clock() / CLOCKS_PER_SEC;
  return 0;
}