#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
const int P = (int)1e9 + 7;
int n, m, k, a[N], b[N];
int fac[N], inv[N], dp[N];
bool Check(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
int Power(int a, int k) {
  int ans = 1;
  while (k) {
    if (k & 1) ans = (long long)ans * a % P;
    a = (long long)a * a % P;
    k >>= 1;
  }
  return ans;
}
void Init() {
  int d = 0;
  for (int i = 1; i <= n; ++i)
    if (Check(a[i])) b[++d] = a[i];
  sort(b + 1, b + 1 + d);
  for (int i = 1; i <= d; ++i) {
    int j = i;
    while (j < d && b[j + 1] == b[i]) j++;
    b[++m] = j - i + 1;
    i = j;
  }
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fac[i] = (long long)fac[i - 1] * i % P;
    inv[i] = Power(fac[i], P - 2);
  }
}
int C(int n, int k) {
  if (n < k) return 0;
  return fac[n] * (long long)inv[k] % P * inv[n - k] % P;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  Init();
  dp[0] = 1;
  for (int i = 1; i <= m; ++i)
    for (int j = k; j >= 1; --j)
      dp[j] = (dp[j] + (long long)dp[j - 1] * b[i]) % P;
  int ans = 0, rem = n;
  for (int i = 1; i <= m; ++i) rem -= b[i];
  for (int x = 0; x <= k; ++x) {
    int y = k - x;
    ans = (ans + (long long)dp[x] * C(rem, y)) % P;
  }
  printf("%d", ans);
  return 0;
}
