#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline string get() {
  char ch[1000010];
  scanf("%s", ch);
  return ch;
}
const int MAX_LG = 21;
const long long maxn = 1e5 + 10;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
pair<long long, long long> a[maxn];
inline bool lucky(long long x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
vector<long long> vc;
long long cnt[maxn];
long long rem = 0;
long long res;
long long dp[maxn];
long long fact[maxn], rev[maxn];
long long cmp[maxn];
inline long long calc(long long n, long long r) {
  if (r < 0 || r > n) return 0;
  return fact[n] * rev[r] % mod * rev[n - r] % mod;
}
inline long long power(long long a, long long b) {
  if (!b) return 1;
  return power(a * a % mod, b >> 1) * (b % 2 ? a : 1) % mod;
}
int32_t main() {
  long long n = in(), k = in();
  rev[0] = fact[0] = 1;
  for (long long i = 1; i < maxn; i++) {
    fact[i] = fact[i - 1] * i % mod;
    rev[i] = rev[i - 1] * power(i, mod - 2) % mod;
  }
  for (long long i = 0; i < n; i++) a[i] = {in(), i};
  sort(a, a + n);
  for (long long i = 0; i < n; i++)
    cmp[i] = (i && a[i].first == a[i - 1].first ? cmp[i - 1] : i);
  for (long long i = 0; i < n; i++) {
    cnt[cmp[i]]++;
    bool fl = lucky(a[i].first);
    if (cnt[cmp[i]] == 1 && fl) vc.push_back(cmp[i]);
    if (!fl) rem++;
  }
  long long sz = (long long)vc.size();
  dp[0] = 1;
  for (long long i = 0; i < sz; i++) {
    for (long long x = 1050; x >= 0; x--) {
      dp[x + 1] += dp[x] * cnt[vc[i]] % mod;
      dp[x + 1] %= mod;
    }
  }
  for (long long x = 0; x <= k; x++) {
    res += calc(rem, k - x) * dp[x] % mod;
    res %= mod;
  }
  cout << res << "\n";
}
