#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 9, MOD = 1e9 + 7;
long long a[N], dp[2][N], fact[N];
unordered_map<long long, long long> mp;
vector<long long> v, vec;
void PREP() {
  fact[0] = dp[1][0] = dp[0][0] = 1;
  for (long long i = 0, t = 0; i < v.size(); i++, t ^= 1)
    for (long long j = 1; j <= i + 1; j++)
      dp[t][j] = (dp[!t][j] + ((dp[!t][j - 1] * v[i]) % MOD)) % MOD;
  for (long long i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % MOD;
}
bool LUCKY(long long x) {
  while (x > 0) {
    if (x % 10 != 7 && x % 10 != 4) return 0;
    x /= 10;
  }
  return 1;
}
long long POW(long long a, long long b) {
  if (b == 0) return 1;
  long long ans = POW(a, b / 2);
  ans = (ans * ans) % MOD;
  if (b % 2) ans = (ans * a) % MOD;
  return ans;
}
long long C(long long a, long long b) {
  return (fact[a] * POW((fact[b] * fact[a - b]) % MOD, MOD - 2)) % MOD;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (LUCKY(a[i]) && mp[a[i]] == 1) vec.push_back(a[i]);
    if (!LUCKY(a[i])) cnt++;
  }
  for (long long x : vec) v.push_back(mp[x]);
  PREP();
  long long ans = 0, t = (v.size() + 1) % 2;
  for (long long i = max(0LL, k - cnt); i <= min(k, (long long)v.size()); i++) {
    ans += (dp[t][i] * C(cnt, k - i));
    ans %= MOD;
  }
  cout << ans;
  return 0;
}
