#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 7;
const int MOD = 1e9 + 7;
void inc(int &a, int b) {
  if ((a += b) >= MOD) a -= MOD;
}
int qpow(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1) {
    if (b & 1) ret = 1ll * ret * a % MOD;
    a = 1ll * a * a % MOD;
  }
  return ret;
}
int fac_pow[MAX_N];
int inv_pow[MAX_N];
int C(int a, int b) {
  if (a < b) return 0;
  int ret = 1ll * fac_pow[a] * inv_pow[b] % MOD;
  return 1ll * ret * inv_pow[a - b] % MOD;
  return ret;
}
bool luck(int dig) {
  for (; dig; dig /= 10)
    if (dig % 10 != 4 && dig % 10 != 7) return false;
  return true;
}
pair<int, int> dig[MAX_N];
int dp[2][MAX_N];
int main() {
  fac_pow[0] = 1;
  for (int i = (1); i < (MAX_N); i++)
    fac_pow[i] = 1ll * fac_pow[i - 1] * i % MOD;
  inv_pow[0] = 1;
  for (int i = (1); i < (MAX_N); i++)
    inv_pow[i] = 1ll * inv_pow[i - 1] * qpow(i, MOD - 2) % MOD;
  int n, k;
  cin >> n >> k;
  for (int i = (0); i < (n); i++) dig[i].first = 1;
  for (int i = (0); i < (n); i++) scanf("%d", &dig[i].second);
  sort(dig, dig + n);
  int dn = 1;
  for (int i = (1); i < (n); i++)
    if (!luck(dig[i].second) || dig[i].second != dig[i - 1].second) {
      dig[dn++] = dig[i];
    } else {
      dig[dn - 1].first++;
    }
  n = dn;
  sort(dig, dig + n);
  reverse(dig, dig + n);
  int m = 0;
  for (; dig[m].first > 1 && m < n; m++)
    ;
  int ans = C(n - m, k);
  memset(dp[0], 0, sizeof(dp[0]));
  for (int i = (0); i < (m); i++) dp[0][i] = dig[i].first;
  int cur = 0;
  for (int i = (1); i < (min(m, k) + 1); i++) {
    int sum = 0;
    for (int j = (0); j < (i); j++) {
      dp[1 ^ cur][j] = 0;
      inc(sum, dp[cur][j]);
    }
    for (int j = (i); j < (m); j++) {
      dp[1 ^ cur][j] = 1ll * sum * dig[j].first % MOD;
      inc(sum, dp[cur][j]);
    }
    inc(ans, 1ll * sum * C(n - m, k - i) % MOD);
    cur ^= 1;
  }
  cout << ans << endl;
}
