#include <bits/stdc++.h>
using namespace std;
unsigned long long hi = 1000000007;
unsigned long long MOD = 1000000007;
unsigned long long fa[200005];
unsigned long long dp[2005][2005];
unsigned long long po(unsigned long long a, unsigned long long b) {
  if (b == 0) return 1;
  unsigned long long x = po(a, b / 2);
  x = (x * x) % hi;
  if (b % 2) x = (x * a) % hi;
  return x;
}
unsigned long long ncr(unsigned long long n, unsigned long long r) {
  if (n < 0) return 0;
  if (r < 0) return 0;
  if (r > n) return 0;
  unsigned long long fir = fa[n];
  unsigned long long sec = (fa[r] * fa[n - r]) % hi;
  sec = po(sec, hi - 2);
  return (fir * sec) % hi;
}
int is(int m) {
  if (m == 0) return 0;
  while (m) {
    if (m % 10 != 4 && m % 10 != 7) return 0;
    m /= 10;
  }
  return 1;
}
unsigned long long a[200005];
unsigned long long ways[3005], tmp[3005];
int main() {
  int n, k;
  fa[0] = 1;
  for (n = 1; n <= 100003; n++) fa[n] = (n * fa[n - 1]) % hi;
  scanf("%d%d", &n, &k);
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  map<unsigned long long, unsigned long long> gr;
  unsigned long long non = 0;
  for (i = 0; i < n; i++)
    if (is(a[i]))
      gr[a[i]]++;
    else
      non++;
  map<unsigned long long, unsigned long long>::iterator I;
  unsigned long long fir, sec;
  for (i = 0; i < gr.size() + 5; i++) ways[i] = tmp[i] = 0;
  ways[0] = tmp[0] = 1;
  int luckyCount = gr.size();
  long long **dp = new long long *[2];
  dp[0] = new long long[luckyCount + 1];
  dp[1] = new long long[luckyCount + 1];
  int c = 0, p = 1;
  for (int j = 0; j <= luckyCount; j++) dp[c][j] = 0;
  dp[c][0] = 1;
  for (typeof((gr).begin()) it = (gr).begin(); it != (gr).end(); it++) {
    c ^= 1;
    p ^= 1;
    int cnt = it->second;
    dp[c][0] = 1;
    for (int j = 1; j <= luckyCount; j++) {
      dp[c][j] = dp[p][j];
      dp[c][j] += (dp[p][j - 1] * cnt) % MOD;
      if (dp[c][j] >= MOD) dp[c][j] -= MOD;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= min(k, luckyCount); i++) {
    ans += dp[c][i] * ncr(non, k - i);
    if (ans >= MOD) ans %= MOD;
  }
  cout << ans;
  return 0;
}
