#include <bits/stdc++.h>
const int N = 100141;
using namespace std;
int n, m, fn, value, cnt, c = 0;
long long dp[N], f[N], mod = 1e9 + 7;
vector<int> a;
vector<int> lk;
bool lucky(int x) {
  while (x > 0) {
    if (x % 10 != 7 && x % 10 != 4) return 0;
    x /= 10;
  }
  return 1;
}
long long binpow(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b) {
    if (b % 2) res = res * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return res;
}
long long C(int kx, int nx) {
  if (nx == 0 || kx > nx || kx < 0) return 0;
  long long fq = binpow(f[kx] * f[nx - kx] % mod, mod - 2) % mod;
  fq *= f[nx] % mod;
  return fq % mod;
}
void fill_fact() {
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= N - 3; i++) {
    f[i] = f[i - 1] * i;
    f[i] %= mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  fill_fact();
  cin >> n >> m;
  fn = n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  for (int i = 0; i < n; i++) {
    value = a[i];
    if (lucky(value)) {
      c = 1;
      while (a[i] == a[i + 1] && i + 1 < n) {
        c++;
        i++;
      }
      lk.push_back(c);
      fn -= c;
    }
  }
  for (int j = 0; j < (int)(lk).size(); j++) {
    cnt = lk[j];
    for (int i = m; i >= 1; i--) {
      if (!dp[i]) continue;
      dp[i + 1] += (long long)(dp[i] * cnt) % mod;
      dp[i + 1] %= mod;
    }
    dp[1] += cnt;
    dp[1] %= mod;
  }
  long long ans = C(m, fn);
  for (int j = 1; j <= m; j++) {
    if (fn < m - j) continue;
    long long R = max((long long)1, C(m - j, fn)) % mod;
    R *= dp[j];
    R %= mod;
    ans += R;
    ans %= mod;
  }
  cout << ans << "\n";
  return 0;
}
