#include <bits/stdc++.h>
using namespace std;
const long long MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 500;
bool lucky(long long x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
long long bin_pow(long long x, long long y) {
  if (y == 0) return 1ll;
  long long res = bin_pow(x, y / 2);
  res = (res * res) % MOD;
  if (y % 2 == 1) res = (res * x) % MOD;
  return res;
}
long long fact[MAXN], ob[MAXN], ans;
long long cnk(long long n, long long k) {
  if (n < k) return 0ll;
  if (k == 0 || n == k) return 1ll;
  return (((fact[n] * ob[k]) % MOD) * ob[n - k]) % MOD;
}
int a[MAXN], b[MAXN], N, n, k, bad;
long long d[1111][1111];
map<int, int> used;
int main() {
  fact[0] = 1ll;
  for (int i = 1; i <= 100000; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
    ob[i] = bin_pow(fact[i], MOD - 2);
  }
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (lucky(a[i]))
      used[a[i]]++;
    else
      bad++;
  }
  for (map<int, int>::iterator it = used.begin(); it != used.end(); it++)
    b[++N] = (*it).second;
  d[0][0] = 1ll;
  for (int i = 1; i <= N; i++) {
    d[i][0] = 1ll;
    for (int j = 1; j <= i; j++)
      d[i][j] =
          (d[i][j] + (d[i - 1][j] + (d[i - 1][j - 1] * b[i]) % MOD) % MOD) %
          MOD;
  }
  for (int i = 0; i <= min(N, k); i++)
    ans = (ans + (d[N][i] * cnk(bad, k - i)) % MOD) % MOD;
  cout << ans;
  return 0;
}
