#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100, mod = 1000000007;
;
int fact[maxn], _fact[maxn];
vector<int> luckies;
int cnt[maxn];
int dp[maxn];
int a[maxn];
int Power(int a, int b) {
  if (b == 0) return 1;
  if (b % 2 == 0)
    return Power(1LL * a * a % mod, b / 2);
  else
    return 1LL * Power(a, b - 1) * a % mod;
}
void init(int x) {
  if (x < 1e8) {
    init(x * 10 + 4);
    init(x * 10 + 7);
  }
  luckies.push_back(x);
}
void _init() {
  fact[0] = 1;
  for (int i = 1; i < maxn; i++) fact[i] = 1LL * fact[i - 1] * i % mod;
  for (int i = 0; i < maxn; i++) _fact[i] = Power(fact[i], mod - 2);
  return;
}
int C(int r, int n) {
  if (r > n) return 0;
  return 1LL * fact[n] * _fact[r] % mod * _fact[n - r] % mod;
}
int main() {
  init(0);
  _init();
  sort(luckies.begin(), luckies.end());
  int n, k, m = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (lower_bound(luckies.begin(), luckies.end(), a[i]) == luckies.end() ||
        (*lower_bound(luckies.begin(), luckies.end(), a[i])) != a[i])
      m++;
    else
      cnt[lower_bound(luckies.begin(), luckies.end(), a[i]) -
          luckies.begin()]++;
  }
  for (int i = 0; i <= k; i++) dp[i] = C(i, m);
  for (int j = 0; j < luckies.size(); j++)
    for (int i = k; i > 0; i--)
      dp[i] = (dp[i] + 1LL * dp[i - 1] * cnt[j]) % mod;
  cout << dp[k] << endl;
  return 0;
}
