#include <bits/stdc++.h>
using namespace std;
stringstream ss;
map<long long, long long> mp;
long long other, sz, K;
long long dp[1024][1024];
long long b[1024], fact[100010];
long long mod = 1e9 + 7LL;
long long is(long long a) {
  while (a) {
    if (a % 10 != 4 && a % 10 != 7) return 0;
    a /= 10;
  }
  return 1;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return res;
}
long long C(long long a, long long b) {
  if (a < b) return 0;
  long long res = fact[a];
  res = (res * power(fact[b], mod - 2)) % mod;
  res = (res * power(fact[a - b], mod - 2)) % mod;
  return res;
}
long long f(long long pos, long long k) {
  if (pos == sz) return C(other, K - k);
  long long ret = 0;
  if (dp[pos][k] != -1) return dp[pos][k];
  if (k < K) ret = (f(pos + 1, k + 1) * b[pos]) % mod;
  ret = (ret + f(pos + 1, k)) % mod;
  return dp[pos][k] = ret;
}
int main() {
  fact[0] = 1;
  for (long long i = 1; i <= 100010; i++) fact[i] = (fact[i - 1] * i) % mod;
  memset(dp, -1, sizeof dp);
  long long n, k, x;
  cin >> n >> k;
  sz = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (is(x)) {
      if (mp.find(x) == mp.end()) mp[x] = sz++;
      b[mp[x]]++;
    } else
      other++;
  }
  K = k;
  cout << f(0, 0) << endl;
  return 0;
}
