#include <bits/stdc++.h>
using namespace std;
int getint() {
  unsigned int c;
  int x = 0;
  while (((c = getchar()) - '0') >= 10) {
    if (c == '-') return -getint();
    if (!~c) exit(0);
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while (((c = getchar()) - '0') < 10);
  return x;
}
long long MOD = 1000000007;
const int MAXN = 100011;
struct modint {
  long long v;
  modint() : v(0) {}
  modint(int v) : v(v > MOD ? v - MOD : v) {}
  modint(long long v) : v(v % MOD) {}
  void null() { v = -1; }
  bool is_null() { return v == -1; }
};
const modint mod = MOD;
modint& operator+=(modint& x, modint y) { return x = x.v + y.v; }
modint& operator-=(modint& x, modint y) { return x = x.v - y.v + MOD; }
modint& operator*=(modint& x, modint y) { return x = (long long)x.v * y.v; }
modint operator+(modint x, modint y) { return x += y; }
modint operator-(modint x, modint y) { return x -= y; }
modint operator*(modint x, modint y) { return x *= y; }
modint operator-(modint x) { return x = modint(0) - x; }
modint minv[MAXN], mfct[MAXN], mifc[MAXN];
modint mod_inv(const modint& a) {
  if (a.v < MAXN and minv[a.v].v) return minv[a.v];
  if (a.v == 1) return minv[a.v] = 1;
  modint res = modint(MOD) - modint(MOD / a.v) * mod_inv(MOD % a.v);
  if (a.v < MAXN) minv[a.v] = res;
  return res;
}
modint& operator/=(modint& x, modint y) { return x *= mod_inv(y); }
modint operator/(modint x, modint y) { return x /= y; }
modint mod_pow(modint x, long long n) {
  modint res = 1;
  for (; n; x *= x, n >>= 1)
    if (n & 1) res *= x;
  return res;
}
modint mod_fact(int n) {
  if (mfct[n].v) return mfct[n];
  mfct[0] = 1;
  for (long long i = 1; i < MAXN; i++) mfct[i] = mfct[i - 1] * i;
  return mfct[n];
}
modint mod_ifact(int n) {
  return mifc[n].v ? mifc[n] : mifc[n] = mod_inv(mod_fact(n));
}
modint mod_cmb(int n, int k) {
  if (k < 0 or n < k) return 0;
  return mod_fact(n) * mod_ifact(k) * mod_ifact(n - k);
}
ostream& operator<<(ostream& os, modint a) {
  os << a.v;
  return os;
}
const int N = 1000111000;
vector<int> am;
void make_lucky(long long n) {
  if (n > N) return;
  if (n) am.push_back(n);
  make_lucky(n * 10 + 7), make_lucky(n * 10 + 4);
}
map<int, int> mp;
int cnt[1111], other, k, nn;
long long dp[100111];
int main() {
  int i, j, tcc, tc = 1 << 28;
  make_lucky(0);
  nn = am.size();
  for (i = 0; i < am.size(); i++) mp[am[i]] = i;
  for (tcc = 0; tcc < tc; tcc++) {
    memset(cnt, 0, sizeof(cnt));
    other = 0;
    int n = getint();
    k = getint();
    for (i = 0; i < n; i++) {
      int t = getint();
      if (mp.count(t))
        cnt[mp[t]]++;
      else
        other++;
    }
    for (i = 0; i <= k; i++) dp[i] = 0;
    dp[0] = 1;
    for (i = 0; i < nn; i++)
      if (cnt[i]) {
        for (j = k - 1; ~j; j--) dp[j + 1] += dp[j] * cnt[i];
        for (j = 0; j <= k; j++) dp[j] %= MOD;
      }
    modint res = 0;
    for (i = 0; i <= k; i++) {
      res += dp[i] * mod_cmb(other, k - i);
    }
    printf("%d\n", (int)res.v);
  }
  return 0;
}
