#include <bits/stdc++.h>
using namespace std;
int N, K;
int F[100000 + 1];
int a[100000 + 1];
int TotalP = 0, CountP = 0;
int ans = 0;
int C[100000 + 1];
inline bool Lucky(int x) {
  while (x != 0) {
    int t = x % 10;
    if (t != 4 && t != 7) return false;
    x /= 10;
  }
  return true;
}
inline int MultMod(const int aa, const int bb) {
  return static_cast<int>(
      (static_cast<long long>(aa) * static_cast<long long>(bb)) % 1000000007);
}
inline int PowMod(const int x, const int p) {
  if (p == 0) return 1;
  int ret = PowMod(x, p / 2);
  return (p % 2) ? MultMod(MultMod(ret, ret), x) : MultMod(ret, ret);
}
inline int DivMod(const int aa, const int bb) {
  return MultMod(aa % 1000000007, PowMod(bb, 1000000007 - 2));
}
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  sort(a + 1, a + N + 1);
  memset(F, 0, sizeof F);
  F[0] = 1;
  for (int i = 1; i <= N; i++)
    if (Lucky(a[i])) {
      CountP++;
      int P = 1;
      while (i + 1 <= N && (a[i] == a[i + 1])) {
        i++;
        P++;
      }
      TotalP += P;
      for (int j = min(CountP, K); j >= 1; j--)
        F[j] = (MultMod(F[j - 1], P) + F[j]) % 1000000007;
    }
  C[0] = 1;
  for (int i = 1; i <= N - TotalP; i++)
    C[i] = DivMod(MultMod(C[i - 1], (N - TotalP - (i - 1))), i);
  for (int i = min(CountP, K); i >= max(0, K - (N - TotalP)); i--)
    ans = (ans + MultMod(F[i], C[K - i])) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
