#include <bits/stdc++.h>
const int N = 100000 + 10;
const int MOD = 1e9 + 7;
int n, m;
int f[N], s[N];
int a[N];
int fac[N], invfac[N];
inline int qmod(int x) { return (x >= MOD) ? (x - MOD) : x; }
inline int qpow(long long b, int p, int mod = MOD) {
  int res = 1;
  while (p) {
    if (p & 1) res = res * b % mod;
    b = b * b % mod;
    p >>= 1;
  }
  return res;
}
bool islucky(int x) {
  while (x) {
    if (x % 10 != 4 and x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
void initfac() {
  int i;
  fac[0] = invfac[0] = 1;
  for (i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % MOD;
  invfac[n] = qpow(fac[n], MOD - 2);
  for (i = n - 1; i; i--) invfac[i] = invfac[i + 1] * (i + 1ll) % MOD;
}
inline int C(int n, int m) {
  return 1ll * fac[m] * invfac[n] % MOD * invfac[m - n] % MOD;
}
int main() {
  int i, j, k, c0 = 0, x;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  std::sort(a + 1, a + 1 + n);
  initfac();
  for (i = 1; i <= n; i = j) {
    j = i;
    while (a[i] == a[j]) j++;
    if (!islucky(a[i])) c0 += j - i;
  }
  for (i = 0; i <= c0; i++) f[i] = C(i, c0);
  for (i = 1; i <= n; i = j) {
    j = i;
    while (a[i] == a[j]) j++;
    x = j - i;
    if (islucky(a[i])) {
      for (k = m; k; k--) f[k] = (f[k] + 1ll * f[k - 1] * x) % MOD;
    }
  }
  printf("%d\n", f[m]);
  return 0;
}
