#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5;
const int MOD = 1e9 + 7;
map<int, int> mp;
int n, m, cnt, num;
int dp[MAX_N] = {1};
int fact[MAX_N], ive_fact[MAX_N];
int pow(int a, int x) {
  int res = 1;
  while (x) {
    if (x & 1) res = 1ll * res * a % MOD;
    x >>= 1;
    a = 1ll * a * a % MOD;
  }
  return res;
}
int calc(int n, int k) {
  if (n < k) return 0;
  int res = fact[n];
  res = 1ll * res * ive_fact[k] % MOD;
  res = 1ll * res * ive_fact[n - k] % MOD;
  return res;
}
void Cnk_init() {
  fact[0] = 1;
  for (int i = 1; i < MAX_N; i++) fact[i] = 1ll * fact[i - 1] * i % MOD;
  for (int i = 0; i < MAX_N; i++) ive_fact[i] = pow(fact[i], MOD - 2);
}
bool check_lucky(int k) {
  while (k > 0) {
    int tmp = k % 10;
    if (tmp != 4 && tmp != 7) return 0;
    k /= 10;
  }
  return 1;
}
void input() {
  mp.clear();
  cnt = num = 0;
  int tmp;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    if (check_lucky(tmp)) {
      if (mp[tmp] == 0) num++;
      mp[tmp]++;
    } else
      cnt++;
  }
}
void solve() {
  num = min(num, m);
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); ++it)
    for (int i = num; i > 0; i--)
      dp[i] = (1ll * dp[i - 1] * (it->second) % MOD + dp[i]) % MOD;
  int ans = 0;
  for (int i = 0; i <= num; i++)
    ans = (1ll * calc(cnt, m - i) * dp[i] % MOD + ans) % MOD;
  printf("%d\n", ans);
}
int main() {
  input();
  Cnk_init();
  solve();
  return 0;
}
