#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = LONG_LONG_MAX;
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const long long maxN = 1e5 + 5;
bool luck(long long x) {
  while (x > 0) {
    if (x % 10 != 4 && x % 10 != 7)
      return false;
    else
      x /= 10;
  }
  return true;
}
long long binpow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1)
      (res *= a) %= mod, n--;
    else
      (a *= a) %= mod, n >>= 1;
  }
  return res;
}
long long inverse(long long a) { return binpow(a, mod - 2); }
long long fact[maxN], inv[maxN], dp[1 << 10][1 << 10];
unordered_map<long long, long long> cnt;
long long nCk(long long n, long long k) {
  if (n < k) return 0;
  return (((fact[n] * inv[k]) % mod) * inv[n - k] % mod);
}
signed main() {
  setup();
  memset(dp, 0, sizeof(dp));
  fact[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i <= 100000; i++) {
    fact[i] = (i * fact[i - 1]) % mod;
    inv[i] = inverse(fact[i]);
  }
  long long n, k;
  cin >> n >> k;
  long long unlucky = 0;
  unordered_set<long long> uni;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (luck(x)) {
      cnt[x]++;
      uni.insert(x);
    } else {
      unlucky++;
    }
  }
  vector<long long> lucknum(uni.begin(), uni.end());
  long long l = lucknum.size();
  dp[0][0] = 1;
  for (long long i = 0; i < l; i++) {
    for (long long j = 0; j < l; j++) {
      (dp[i + 1][j + 1] += dp[i][j] * cnt[lucknum[i]]) %= mod;
      (dp[i + 1][j] += dp[i][j]) %= mod;
    }
  }
  long long ans = 0;
  for (long long i = 0; i <= l; i++) {
    (ans += dp[l][i] * nCk(unlucky, k - i)) %= mod;
  }
  cout << ans;
  return 0;
}
