#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
const int MAXV = 100005;
int total;
long long int num[MAXN];
long long int fact[MAXV];
unordered_set<int> s;
long long int memo[MAXN][MAXN];
unordered_map<int, int> check;
pair<long long int, long long int> ExtendedEuclid(long long int a,
                                                  long long int b) {
  if (b == 0) return pair<long long int, long long int>(1, 0);
  pair<long long int, long long int> aux = ExtendedEuclid(b, a % b);
  return pair<long long int, long long int>(aux.second,
                                            aux.first - aux.second * (a / b));
}
long long int modinv(long long int a, long long int mod) {
  return (ExtendedEuclid(a, mod).first + mod) % mod;
}
bool Lucky(int a) {
  while (a) {
    if (a % 10 != 4 && a % 10 != 7) return 0;
    a /= 10;
  }
  return 1;
}
long long int C(long long int a, long long int b) {
  if (b > a || a < 0 || b < 0) return 0;
  long long int uno = fact[a];
  long long int dos = (fact[b] * fact[a - b]) % 1000000007;
  return (uno * modinv(dos, 1000000007)) % 1000000007;
}
long long int DP(int id, int cont) {
  if (cont < 0) return 0;
  if (id == total) return (cont == 0);
  if (memo[id][cont] != -1LL) return memo[id][cont];
  long long int r = DP(id + 1, cont);
  r = (r + DP(id + 1, cont - 1) * num[id]) % 1000000007;
  return memo[id][cont] = r;
}
int main() {
  fact[0] = 1;
  for (long long int i = 1; i < MAXV; i++)
    fact[i] = (fact[i - 1] * i) % 1000000007;
  int n, k, a;
  scanf("%d %d", &n, &k);
  int cont = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    if (Lucky(a)) {
      check[a]++;
      s.insert(a);
    } else
      cont++;
  }
  for (auto it : s) num[total++] = check[it];
  for (int i = 0; i < total; i++)
    for (int j = 0; j <= total; j++) memo[i][j] = -1LL;
  long long int res = 0;
  for (int i = 0; i <= total; i++) {
    res = (res + DP(0, i) * C(cont, k - i)) % 1000000007;
  }
  printf("%lld\n", res);
  return 0;
}
