#include <bits/stdc++.h>
using namespace std;
const int N = 100086;
const int M = 2300;
const long long mod = 1000000007;
long long f[N];
long long dp[M][M];
map<int, int> mp;
bool islucky(int n) {
  while (n) {
    int tmp = n % 10;
    if (tmp != 4 && tmp != 7) return false;
    n /= 10;
  }
  return true;
}
long long powmod(long long a, long long b) {
  long long re = 1;
  while (b) {
    if (b & 1) re = re * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return re;
}
long long c(int n, int k) {
  if (n < k) return 0;
  long long re = 0;
  re = f[n] * powmod(f[k], mod - 2) % mod;
  re = re * powmod(f[n - k], mod - 2) % mod;
  return re;
}
void init() {
  f[0] = f[1] = 1;
  for (int i = 2; i < N; i++) f[i] = f[i - 1] * (long long)(i) % mod;
}
int main() {
  init();
  int n, k, tmp;
  while (scanf("%d %d", &n, &k) == 2) {
    mp.clear();
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &tmp);
      if (islucky(tmp)) mp[tmp]++;
    }
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    int ind = 0;
    for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
      tmp = it->second;
      n -= tmp;
      for (int i = 0; i <= ind; i++) {
        dp[ind + 1][i] = (dp[ind + 1][i] + dp[ind][i]) % mod;
        dp[ind + 1][i + 1] =
            (dp[ind + 1][i + 1] + dp[ind][i] * tmp % mod) % mod;
      }
      ind++;
    }
    for (int i = 0; i <= min(k, ind); i++) {
      ans = (ans + dp[ind][i] * c(n, k - i) % mod) % mod;
    }
    printf("%I64d\n", ans % mod);
  }
  return 0;
}
