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 mod = 1009;
namespace fft {
const int L = 18, FN = (1 << L);
int rev[FN];
const double pi = 3.1415926535897932384626433832795028841971l;
const double two_pi = pi * 2;
struct cp {
  double x, y;
  cp() {}
  cp(double _x) : x(_x), y(0) {}
  cp(double _x, double _y) : x(_x), y(_y) {}
  inline cp operator+(const cp &p) const { return cp(x + p.x, y + p.y); }
  inline cp operator-(const cp &p) const { return cp(x - p.x, y - p.y); }
  inline cp operator*(const cp &p) const {
    return cp(x * p.x - y * p.y, x * p.y + y * p.x);
  }
  inline cp operator!() const { return cp(x, -y); }
} nw[FN + 1], f[FN], g[FN], h[FN], hh[FN];
void init() {
  rev[0] = 0;
  for (int i = 1; i < FN; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (L - 1));
  nw[0] = nw[FN] = cp(1, 0);
  for (int i = 1; i <= (FN >> 1); i++)
    nw[i] = cp(cos(i * two_pi / FN), sin(i * two_pi / FN));
  for (int i = (FN >> 1) + 1; i < FN; i++) nw[i] = !nw[FN - i];
}
void dft(cp *a, int n, int fg) {
  int d = __builtin_ctz(FN / n);
  for (int i = 0; i < n; i++)
    if (i < (rev[i] >> d)) swap(a[i], a[rev[i] >> d]);
  for (int size = 2; size <= n; size <<= 1) {
    int step = FN / size;
    if (fg) step = -step;
    for (int i = 0; i < n; i += size) {
      cp *u = a + i, *v = a + (i + (size >> 1)), *w = fg ? nw + FN : nw;
      for (int k = (size >> 1); k--;) {
        cp tmp = (*v) * (*w);
        *v = *u - tmp, *u = *u + tmp;
        u++, v++, w += step;
      }
    }
  }
  if (fg)
    for (int i = 0; i < n; i++) a[i].x /= n, a[i].y /= n;
}
void multiply(vector<int> &a, vector<int> &b, vector<int> &c) {
  int n1 = a.size(), n2 = b.size(), n = 1;
  while (n <= n1 + n2) n <<= 1;
  for (int i = 0; i < n; i++) {
    f[i] = cp((double)(i < n1 ? a[i] : 0));
    g[i] = cp((double)(i < n2 ? b[i] : 0));
  }
  dft(f, n, 0);
  dft(g, n, 0);
  for (int i = 0; i < n; i++) {
    h[i] = f[i] * g[i];
  }
  dft(h, n, 1);
  c.resize(n1 + n2 - 1);
  for (int i = 0; i < c.size(); i++) c[i] = ((long long)(h[i].x + 0.5)) % mod;
}
}  // namespace fft
int n, m, k;
int a[202020];
void solve(int st, int en, vector<int> &z) {
  z.clear();
  if (a[st] == a[en]) {
    z.resize(en - st + 2, 1);
    return;
  }
  int mid = (st + en) >> 1;
  if (a[mid] != a[en]) {
    while (a[mid] == a[mid + 1]) mid++;
  } else {
    while (a[mid] == a[mid + 1]) mid--;
  }
  vector<int> x, y;
  solve(st, mid, x);
  solve(mid + 1, en, y);
  fft::multiply(x, y, z);
}
vector<int> answer;
int main() {
  fft::init();
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  solve(1, n, answer);
  printf("%d\n", answer[k]);
  return 0;
}