#include <bits/stdc++.h>
using namespace std;
long long N, K, normal, ans, idx;
long long a[200005];
long long fact[200005];
long long finv[200005];
long long cub[200005];
long long tnom[200005];
long long dp[200005];
unordered_map<long long, long long> mp;
bool lucky(long long x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
long long fastpow(long long b, long long e) {
  long long ans = 1;
  while (e > 0) {
    if (e & 1) ans = (ans * b) % 1000000007;
    b = (b * b) % 1000000007;
    e >>= 1;
  }
  return ans;
}
long long nCk(long long n, long long k) {
  return (fact[n] * ((finv[k] * finv[n - k]) % 1000000007)) % 1000000007;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N >> K;
  fact[0] = finv[0] = 1;
  for (long long i = 1; i <= N; i++) {
    cin >> a[i];
    fact[i] = (fact[i - 1] * i) % 1000000007;
    finv[i] = fastpow(fact[i], 1000000007 - 2);
    if (lucky(a[i])) {
      if (!mp[a[i]]) mp[a[i]] = ++idx;
      cub[mp[a[i]]]++;
    } else
      normal++;
  }
  tnom[0] = 1;
  for (long long i = 1; i <= min(normal, K); i++) tnom[i] = nCk(normal, i);
  dp[0] = 1;
  for (long long i = 1; i <= idx; i++)
    for (long long j = K; j >= 1; j--) {
      dp[j] += cub[i] * dp[j - 1];
      dp[j] %= 1000000007;
    }
  for (int i = 0; i <= K; i++) {
    ans += (tnom[K - i] * dp[i]);
    ans %= 1000000007;
  }
  cout << ans;
  return 0;
}
