#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int n, k, arr[maxn], unluck, ispreluck, pos;
long long dp[2][maxn];
vector<int> luckseq;
bool islucky(int num) {
  while (num > 0) {
    if (num % 10 != 4 && num % 10 != 7) return false;
    num /= 10;
  }
  return true;
}
const long long mod = 1e9 + 7;
long long fact[maxn], inv[maxn], ifact[maxn];
void calcInv() {
  for (int i = 0; i < 2; i++) {
    fact[i] = 1;
    ifact[i] = 1;
    inv[i] = 1;
  }
  for (int i = 2; i < maxn; i++) {
    fact[i] = (i * fact[i - 1]) % mod;
    long long q = mod / i, r = mod % i;
    inv[i] = (-q * inv[r]) % mod;
    inv[i] = (inv[i] + mod) % mod;
    ifact[i] = (inv[i] * ifact[i - 1]) % mod;
  }
}
long long ncr(long long n, long long r) {
  if (n < r) return 0LL;
  return (((fact[n] * ifact[r]) % mod) * ifact[n - r]) % mod;
}
void solve() {
  dp[0][0] = 1;
  dp[1][0] = 1;
  for (int i = 0; i < luckseq.size(); i++) {
    for (int j = 1; j <= 1025; j++) {
      dp[1 - pos][j] = (dp[pos][j] + (dp[pos][j - 1] * luckseq[i]) % mod) % mod;
    }
    pos = 1 - pos;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  calcInv();
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  if (islucky(arr[0])) {
    ispreluck = 1;
    luckseq.push_back(1);
  } else
    unluck++;
  for (int i = 1; i < n; i++) {
    if (arr[i] == arr[i - 1]) {
      if (ispreluck)
        luckseq[luckseq.size() - 1]++;
      else
        unluck++;
    } else {
      ispreluck = 0;
      if (islucky(arr[i])) {
        ispreluck = 1;
        luckseq.push_back(1);
      } else
        unluck++;
    }
  }
  if (luckseq.empty()) {
    cout << ncr(unluck, k);
    return 0;
  }
  solve();
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    ans = (ans + ncr(unluck, k - i) * dp[pos][i]) % mod;
  }
  cout << ans;
  return 0;
}
