#include <bits/stdc++.h>
using namespace std;
vector<int> lucky;
void solver(int len, int num = 0) {
  if (len == 0) {
    lucky.push_back(num);
    return;
  }
  solver(len - 1, 10 * num + 4);
  solver(len - 1, 10 * num + 7);
}
int a[100010];
map<int, int> idx;
int cnt[1024];
const long long mod = 1000000007;
long long modpow(int b, int e) {
  if (e == 0) return 1;
  if (e & 1) return (modpow(b, e - 1) * b) % mod;
  long long m = modpow(b, e >> 1);
  return (m * m) % mod;
}
long long f[100010];
long long inv[100010];
long long nCr(int n, int r) {
  if (n < r) return 0;
  long long num = f[n];
  long long den = (inv[r] * inv[n - r]) % mod;
  return (num * den) % mod;
}
long long dp[1024][1024];
int main() {
  for (int i = 1; i <= 9; i++) {
    solver(i);
  }
  for (unsigned i = 0; i < lucky.size(); i++) {
    idx[lucky.at(i)] = i + 1;
  }
  f[0] = inv[0] = 1;
  for (int i = 1; i <= 100000; i++) {
    f[i] = f[i - 1] * i;
    f[i] %= mod;
    inv[i] = modpow(f[i], mod - 2);
  }
  int n, k, unlucky = 0;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (idx.count(a[i])) {
      cnt[idx[a[i]]] += 1;
    } else {
      ++unlucky;
    }
  }
  for (int i = 0; i <= (int)lucky.size(); i++) {
    dp[i][0] = 1;
  }
  for (int i = 1; i <= (int)lucky.size(); i++) {
    for (int j = 1; j <= (int)lucky.size(); j++) {
      dp[i][j] = dp[i - 1][j];
      dp[i][j] += dp[i - 1][j - 1] * cnt[i];
      dp[i][j] %= mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    if (i > (int)lucky.size()) break;
    ans += dp[lucky.size()][i] * nCr(unlucky, k - i);
    ans %= mod;
  }
  printf("%lld\n", ans);
  return 0;
}
