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;
namespace FFT {
struct C {
  double a, b;
  C() {}
  C(double a, double b) : a(a), b(b) {}
  C(long long x) : a(x), b(0) {}
  C operator=(int a) {
    *this = C(a * 1.0, 0);
    return *this;
  }
  C operator+(const C &t) { return C(a + t.a, b + t.b); }
  C operator-(const C &t) { return C(a - t.a, b - t.b); }
  C operator*(const C &t) { return C(a * t.a - b * t.b, a * t.b + b * t.a); }
};
const long long maxn = 1 << 19;
void FFT(C *a, int n, int f, const int g[]) {
  for (int i = 0; i < n; i++)
    if (i > g[i]) swap(a[i], a[g[i]]);
  for (int i = 1; i < n; i <<= 1) {
    C w = C(cos(acos(-1.0) / i), f * sin((acos(-1.0)) / i)), x, y;
    for (int j = 0; j < n; j += i + i) {
      C e;
      e = 1;
      for (int k = 0; k < i; e = e * w, k++) {
        x = a[j + k];
        y = a[j + k + i] * e;
        a[j + k] = x + y;
        a[j + k + i] = x - y;
      }
    }
  }
  if (f == -1)
    for (int i = 0; i < n; i++) a[i] = a[i] * C(1.0 / n, 0);
}
long long conv(C a[], int n, C b[], int m) {
  static int g[maxn];
  int k = 0, s = 2;
  while (s < n + m) k++, s <<= 1;
  for (int i = 1; i < s; i++) g[i] = (g[i >> 1] >> 1) | ((i & 1) << k);
  for (int i = n; i < s; i++) a[i] = 0;
  for (int i = m; i < s; i++) b[i] = 0;
  FFT(a, s, 1, g);
  FFT(b, s, 1, g);
  for (int i = 0; i < s; i++) a[i] = a[i] * b[i];
  FFT(a, s, -1, g);
  return s;
}
}  // namespace FFT
long long m, n, k, x, num[200005];
class poly {
 public:
  vector<long long> a;
  void init(long long num) {
    a.resize(num + 1);
    for (long long i = 0; i <= num; i++) a[i] = 1;
  }
  void print() {
    for (auto i : a) cout << " " << i;
    cout << endl;
  }
  poly &operator*=(poly &b) {
    static FFT::C A[1 << 19], B[1 << 19];
    for (long long i = 0; i <= (long long)a.size() - 1; i++) A[i] = a[i];
    for (long long i = 0; i <= (long long)b.a.size() - 1; i++) B[i] = b.a[i];
    long long len = min(FFT::conv(A, a.size(), B, b.a.size()), k + 1);
    a.resize(len);
    for (long long i = 0; i <= len - 1; i++)
      a[i] = (long long)round(A[i].a) % 1009;
    return *this;
  }
} p[200005];
void solve(long long l, long long r) {
  if (l >= r) return;
  long long mid = (l + r) >> 1;
  solve(l, mid);
  solve(mid + 1, r);
  p[l] *= p[mid + 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  k = min(n - k, k);
  for (long long i = 1; i <= n; i++) cin >> x, num[x]++;
  for (long long i = 1; i <= m; i++) p[i].init(num[i]);
  solve(1, m);
  long long ans = (p[1].a.size() >= k + 1) ? p[1].a[k] : 0;
  cout << ans << endl;
  return 0;
}