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;
long long int gcd(long long int a, long long int b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long double dist(long double x, long double arayikhalatyan, long double x2,
                 long double y2) {
  return sqrt((x - x2) * (x - x2) +
              (arayikhalatyan - y2) * (arayikhalatyan - y2));
}
long long int S(long long int a) { return (a * (a + 1LL)) / 2; }
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
char vow[] = {'a', 'e', 'i', 'o', 'u'};
int dx[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};
int dy[] = {0, 0, 1, -1, -1, 1, -1, 1, 0};
const int N = 1e6 + 30;
const long long int mod = 1009;
const long double pi = acos(-1);
const int T = 238;
const long double e = 1e-13;
long long int bp(long long int a, long long int b = mod - 2LL) {
  long long int ret = 1;
  while (b) {
    if (b & 1) ret *= a, ret %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return ret;
}
ostream& operator<<(ostream& c, pair<int, int> a) {
  c << a.first << " " << a.second;
  return c;
}
struct pt {
  long long int x, y;
  int ind;
  int bl;
  bool operator==(const pt& a) { return ind == a.ind; }
  bool operator<(const pt& b) {
    if (x == b.x) return y < b.y;
    return x < b.x;
  }
};
int n, m, k;
vector<complex<long double> > pat;
int col[N];
int rev[N];
complex<long double> roots[N];
void fft(vector<complex<long double> >& a) {
  int n = a.size();
  for (int i = 0; i < n; ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int len = 1, step = n / 2; len < n; len <<= 1, step >>= 1)
    for (int st = 0; st < n; st += len + len)
      for (int i = 0, root = 0; i < len; ++i, root += step) {
        complex<long double> u = a[st + i], v = roots[root] * a[st + len + i];
        a[st + i] = u + v;
        a[st + i + len] = u - v;
      }
}
void inv(vector<complex<long double> >& a) {
  fft(a);
  reverse(a.begin() + 1, a.end());
  for (complex<long double>& x : a) x /= a.size();
}
void conv(vector<complex<long double> >& a, vector<complex<long double> >& b) {
  int n = 1, h = 0;
  while (n < a.size() + b.size()) n *= 2, ++h;
  while (a.size() < n) a.push_back(0);
  while (b.size() < n) b.push_back(0);
  rev[0] = 0;
  for (int i = 1, high = -1; i < n; ++i) {
    high += !(i & (i - 1));
    rev[i] = rev[i ^ (1 << high)] | (1 << (h - high - 1));
  }
  long double sector = 2. * pi / n;
  for (int i = 0; i < n; ++i) {
    roots[i] = complex<long double>(cos(sector * i), sin(sector * i));
  }
  fft(a);
  fft(b);
  for (int i = 0; i < n; ++i) a[i] *= b[i];
  inv(a);
}
vector<complex<long double> > rec(int l, int r) {
  vector<complex<long double> > ret;
  if (l == r) {
    for (int i = 0; i <= col[l]; i++) {
      ret.push_back(1);
    }
    return ret;
  }
  int mid = (l + r) / 2;
  ret = rec(l, mid);
  vector<complex<long double> > ret1 = rec(mid + 1, r);
  conv(ret, ret1);
  vector<int> a;
  for (auto p : ret) {
    a.push_back((long long int)(p.real() + 0.45) % mod);
  }
  while (!a.back()) a.pop_back();
  vector<complex<long double> > ans(a.begin(), a.end());
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    col[x]++;
  }
  pat = rec(1, m);
  cout << pat[k].real() << endl;
  return 0;
}