#include <bits/stdc++.h>
using namespace std;
template <class T>
void checkmin(T &t, T x) {
  if (x < t) t = x;
}
template <class T>
void checkmax(T &t, T x) {
  if (x > t) t = x;
}
const int N = 105555;
const int mod = 1000000007;
int n, m;
int a[N];
int fac[N], inv[N];
map<int, int> cnt;
int F[N];
bool lucky(int x) {
  while (x) {
    int tmp = x % 10;
    x /= 10;
    if (tmp != 4 && tmp != 7) return false;
  }
  return true;
}
int pow(int a, int b) {
  if (a == 0) return 0;
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1LL * ret * a % mod;
    a = 1LL * a * a % mod;
    b >>= 1;
  }
  return ret;
}
void init_C(int m) {
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= m; i++) {
    fac[i] = 1LL * fac[i - 1] * i % mod;
    inv[i] = pow(fac[i], mod - 2);
  }
}
int C(int m, int n) {
  if (n < 0 || n > m) return 0;
  return 1LL * fac[m] * inv[n] % mod * inv[m - n] % mod;
}
int main() {
  scanf("%d%d", &n, &m);
  cnt.clear();
  int other = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (lucky(a[i])) {
      cnt[a[i]]++;
    } else {
      other++;
    }
  }
  init_C(100000);
  int ans = 0;
  if (other >= m) ans += C(other, m);
  memset(F, 0, sizeof(F));
  for (int i = 0; i <= m; i++) F[i] = C(other, i);
  for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); it++)
    for (int j = m - 1; j >= 0; j--) {
      F[j + 1] += 1LL * F[j] * it->second % mod;
      F[j + 1] %= mod;
    }
  printf("%d\n", F[m]);
  return 0;
}
