#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long MOD = 1e9 + 7;
long long cnt[1025];
map<int, int> numbers;
int all_cnt = 0;
void dfs(long long numb) {
  if (numb > MOD) return;
  numbers[numb] = ++all_cnt;
  dfs(numb * 10 + 4);
  dfs(numb * 10 + 7);
}
int mas[100100];
long long dp[1025][1025];
long long go(int step, int last) {
  if (step == 0) {
    if (last == 0) return 1;
    return dp[0][last] = 1;
  }
  if (last == 0) return 0;
  if (dp[step][last] != -1) return dp[step][last];
  long long ans = 0;
  ans = go(step, last - 1);
  ans += go(step - 1, last - 1) * cnt[last];
  return dp[step][last] = (ans % MOD);
}
long long obr(long long x) {
  long long res = 1;
  long long step = MOD - 2;
  long long a = x;
  while (step) {
    if (step & 1) res *= a, res %= MOD;
    a *= a, a %= MOD;
    step >>= 1;
  }
  return res;
}
long long fact[100100];
long long bin(int m, int n) {
  if (m > n) return 0;
  long long res = (fact[n] * obr(fact[n - m])) % MOD * obr(fact[m]);
  res %= MOD;
  return res;
}
void solve() {
  int n = ri(), k = ri();
  dfs(0);
  for (int i = (int)(1); i <= (int)(n); i++) {
    mas[i] = ri();
    if (numbers.find(mas[i]) == numbers.end())
      cnt[0]++;
    else
      cnt[numbers[mas[i]]]++;
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 1;
  for (int i = (int)(0); i <= (int)(1024); i++) go(i, 1024);
  long long res = 0;
  fact[0] = 1;
  for (int i = (int)(1); i <= (int)(100000); i++)
    fact[i] = (fact[i - 1] * 1LL * i) % MOD;
  for (int i = (int)(0); i <= (int)(1024); i++) {
    res += (dp[i][1024] * bin(k - i, cnt[0])) % MOD;
    res %= MOD;
  }
  cout << res << endl;
}
int main() {
  solve();
  return 0;
}
