#include <bits/stdc++.h>
using namespace std;
int A[100005];
map<int, int> L;
map<int, int>::iterator it;
vector<int> V;
long long int dp[2000][2000];
bool vis[2000][2000];
long long int solve(int pos, int Count) {
  if (Count == 0) return 1;
  if (pos == 0) return 0;
  if (vis[pos][Count] == 1) return dp[pos][Count];
  vis[pos][Count] = 1;
  long long int ret = solve(pos - 1, Count);
  ret += (solve(pos - 1, Count - 1) * V[pos - 1]) % 1000000007;
  return dp[pos][Count] = ret % 1000000007;
}
bool isLucky(int n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7) return false;
    n = n / 10;
  }
  return true;
}
long long int bigMod(long long int n, long long int r) {
  if (r == 0) return 1LL;
  long long int ret = bigMod(n, r / 2);
  ret = (ret * ret) % 1000000007;
  if (r % 2 == 1) ret = (ret * n) % 1000000007;
  return ret;
}
long long int Fact[100005];
long long int Inv[100005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  Fact[0] = Inv[0] = 1;
  for (int i = 1; i < 100005; i++) Fact[i] = (Fact[i - 1] * i) % 1000000007;
  for (int i = 1; i < 100005; i++) Inv[i] = bigMod(Fact[i], 1000000007 - 2);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  int Unlucky = 0;
  for (int i = 1; i <= n; i++) {
    if (isLucky(A[i]))
      L[A[i]]++;
    else
      Unlucky++;
  }
  for (it = L.begin(); it != L.end(); it++) V.push_back(it->second);
  long long int Ans = 0;
  for (int Li = max(0, k - Unlucky); Li <= min(k, (int)V.size()); Li++) {
    long long int now = solve(V.size(), Li);
    long long int nCr =
        (Fact[Unlucky] *
         ((Inv[k - Li] * Inv[Unlucky - (k - Li)]) % 1000000007)) %
        1000000007;
    Ans += (now * nCr) % 1000000007;
    Ans %= 1000000007;
  }
  cout << Ans << endl;
}
