#include <bits/stdc++.h>
using namespace std;
long long x, y;
long long exgcd(long long a, long long b) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = exgcd(b, a % b);
  long long tmp = x;
  x = y;
  y = tmp - (a / b) * y;
  return d;
}
long long mod = 1000000007;
long long inver(long long a, long long b) {
  exgcd(a, b);
  x %= b;
  if (x < 0) x += b;
  return x;
}
long long fac[100010], rev[100010], dp[100010], c[100010];
int sure(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
long long com(long long n, long long m) {
  if (!m) return 1;
  if (n == m) return 1;
  return fac[n] * rev[m] % mod * rev[n - m] % mod;
}
int a[100010];
int main() {
  long long n, m, i, j, k;
  scanf("%I64d%I64d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  fac[0] = 1;
  for (i = 1; i <= n; i++) fac[i] = i * fac[i - 1] % mod;
  rev[1] = 1;
  for (i = 2; i <= n; i++) rev[i] = rev[i - 1] * inver(i, mod) % mod;
  i = 1;
  long long tol = 0;
  long long cnt = 0;
  while (i <= n) {
    j = i;
    while (j <= n && a[j] == a[i]) j++;
    if (sure(a[i]))
      c[++cnt] = j - i;
    else
      tol += (j - i);
    i = j;
  }
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;
  for (i = 1; i <= cnt; i++)
    for (j = min(m, cnt); j >= 1; j--) dp[j] = (dp[j] + dp[j - 1] * c[i]) % mod;
  long long ans = 0;
  for (i = 0; i <= tol && i <= m; i++)
    ans = (ans + dp[m - i] * com(tol, i)) % mod;
  printf("%I64d\n", ans);
  cin >> ans;
  return 0;
}
