#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
const long long int P = 1e9 + 7;
long long int c[MAX_N];
void GcdEx(long long int a, long long int b, long long int& x,
           long long int& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  GcdEx(b, a % b, x, y);
  long long int t = x;
  x = y;
  y = t - a / b * y;
}
void IniC(long long int upper, long long int lower) {
  c[0] = 1;
  long long int x, y;
  for (int i = 1; i <= lower; ++i) {
    c[i] = (c[i - 1] * (upper - i + 1)) % P;
    GcdEx(i, P, x, y);
    c[i] = (c[i] * x) % P;
    while (c[i] < 0) c[i] += P;
  }
}
long long int C(int a, int b) {
  if (a - b < b) return c[a - b];
  return c[b];
}
bool isLucky(int num) {
  int md;
  do {
    md = num % 10;
    if (md != 7 && md != 4) return false;
    num /= 10;
  } while (num);
  return true;
}
map<int, int> luck_num;
int n, k;
int unl_cnt = 0;
long long int dp[MAX_N];
int dp_e = 0;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    int cur;
    scanf("%d", &cur);
    if (isLucky(cur))
      ++luck_num[cur];
    else
      ++unl_cnt;
  }
  int ini_bound = k;
  if (k > unl_cnt - k) ini_bound = unl_cnt / 2;
  IniC(unl_cnt, ini_bound);
  dp[0] = 1;
  for (map<int, int>::iterator it = luck_num.begin(); it != luck_num.end();
       ++it) {
    dp_e = min(k, dp_e + 1);
    for (int j = dp_e; j > 0; --j) {
      dp[j] = (dp[j] + dp[j - 1] * it->second) % P;
    }
  }
  long long int ans = 0;
  for (int i = 0; i <= dp_e; ++i) {
    if (k - i > unl_cnt) continue;
    ans = (ans + dp[i] * C(unl_cnt, k - i)) % P;
  }
  printf("%I64d\n", ans);
  return 0;
}
