#include <bits/stdc++.h>
using namespace std;
map<int, int> h;
const int N = 100003;
const int MOD = 1000000007;
int n, k, rest = 0, a[N], b[N];
bool OK(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
int cnx_power(int x, int y) {
  long long ret = 1, tmp = x;
  while (y) {
    if (y & 1) ret *= tmp, ret %= MOD;
    tmp *= tmp;
    tmp %= MOD;
    y >>= 1;
  }
  return ret % MOD;
}
int inv(int x) { return cnx_power(x, MOD - 2); }
int dp[2003][2003];
int s[2003][2];
void Prepare() {
  int cnt = 0;
  for (map<int, int>::iterator it = h.begin(); it != h.end(); ++it) {
    ++cnt;
    s[cnt][0] = it->first;
    s[cnt][1] = it->second;
  }
  dp[0][0] = 1;
  for (int i = 1; i <= cnt; ++i) {
    dp[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      dp[i][j] = dp[i - 1][j];
      long long tmp = 1LL * dp[i - 1][j - 1] * s[i][1] % MOD;
      dp[i][j] += tmp;
      if (dp[i][j] >= MOD) dp[i][j] -= MOD;
    }
  }
}
int main() {
  h.clear();
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    if (OK(x))
      ++h[x];
    else
      ++rest;
  }
  int s1 = h.size();
  int s2 = rest;
  a[0] = b[0] = 1;
  for (int i = 1; i <= s1; ++i) {
    a[i] = 1LL * a[i - 1] * (s1 - i + 1) % MOD * inv(i) % MOD;
  }
  for (int i = 1; i <= s2; ++i) {
    b[i] = 1LL * b[i - 1] * (s2 - i + 1) % MOD * inv(i) % MOD;
  }
  Prepare();
  int ans = 0;
  for (int i = 0; i <= k && i <= s1; ++i) {
    long long tmp = 1LL * dp[s1][i] * b[k - i] % MOD;
    ans += tmp;
    if (ans >= MOD) ans -= MOD;
  }
  printf("%d\n", ans);
  return 0;
}
