#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int mod = 1e9 + 7;
long long F[N], invF[N];
long long power_mod(long long a, long long b) {
  long long ret = 1;
  for (a %= mod; b; b >>= 1, a = a * a % mod)
    if (b & 1) ret = ret * a % mod;
  return ret;
}
void init() {
  F[0] = invF[0] = 1;
  for (int i = 1; i < N; i++) F[i] = F[i - 1] * i % mod;
  invF[N - 1] = power_mod(F[N - 1], mod - 2);
  for (int i = N - 2; i; i--) invF[i] = invF[i + 1] * (i + 1) % mod;
}
long long C(int n, int m) {
  if (n < m || m < 0) return 0;
  return F[n] * invF[m] % mod * invF[n - m] % mod;
}
int n, k, t, cnt;
map<int, int> mp;
inline bool chk(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
vector<int> P[2007];
priority_queue<pair<int, int> > pq;
void mul(vector<int> &A, vector<int> &B) {
  vector<int> ret(A.size() + B.size() - 1);
  for (int i = 0; i < int(A.size()); i++)
    for (int j = 0; j < int(B.size()); j++)
      (ret[i + j] += 1ll * A[i] * B[j] % mod) %= mod;
  A = ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  init();
  cin >> n >> k;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    if (chk(x))
      mp[x]++;
    else
      t++;
  }
  for (auto e : mp) {
    P[cnt].resize(2);
    P[cnt][0] = 1, P[cnt][1] = e.second;
    pq.push(pair<int, int>(-2, cnt));
    cnt++;
  }
  if (pq.size() == 0) return cout << C(n, k) << endl, 0;
  while (pq.size() > 1) {
    int t1 = pq.top().second;
    pq.pop();
    int t2 = pq.top().second;
    pq.pop();
    mul(P[t1], P[t2]);
    pq.push(pair<int, int>(-int(P[t1].size()), t1));
  }
  long long res = 0;
  int tt = pq.top().second;
  int w = min(k + 1, int(P[tt].size()));
  for (int i = 0; i < w; i++) (res += P[tt][i] * C(t, k - i) % mod) %= mod;
  cout << res << endl;
  return 0;
}
