#include <bits/stdc++.h>
using namespace std;
int in() {
  int x = 0, c;
  for (; (unsigned int)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned int)((c = getchar()) - '0') < 10);
  return x;
}
int P;
long long f[100000 + 1], inv[100000 + 1];
long long bpow(long long a, long long b) {
  return b ? bpow(a * a % P, b / 2) * (b & 1 ? a : 1) % P : 1;
}
unordered_map<int, int> lucky;
int islucky(int n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7)
      return false;
    else
      n /= 10;
  }
  return true;
}
long long dp[1201] = {};
int main() {
  P = 1000000007;
  f[0] = 1;
  for (int i = 1; i <= 100000; i++) f[i] = (i * f[i - 1]) % P;
  inv[100000] = bpow(f[100000], P - 2);
  for (int i = 100000 - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % P;
  int N = in(), K = in();
  lucky[0] = 0;
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    int a = in();
    if (!islucky(a)) a = 0;
    lucky[a]++;
  }
  unordered_map<int, int>::iterator it = lucky.begin();
  while (it != lucky.end()) {
    if (it->first != 0)
      for (int i = 1200; i >= 1; i--)
        dp[i] += dp[i - 1] * it->second, dp[i] %= P;
    it++;
  }
  long long ans = 0;
  int all = lucky[0];
  for (int i = 0; i <= K; i++) {
    int o = K - i;
    if (o > all) continue;
    ans += (i >= 1200 ? 0 : dp[i]) * f[all] % P * inv[all - o] % P * inv[o] % P;
    ans %= P;
  }
  printf("%I64d\n", ans);
}
