#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int N = 100005, mod = 1000000000 + 7;
int Add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
int Sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
int Mul(int a, int b) { return (long long)a * b % mod; }
void add(int &a, int b) {
  a += b;
  (a >= mod) && (a -= mod);
}
void sub(int &a, int b) {
  a -= b;
  (a < 0) && (a += mod);
}
void mul(int &a, int b) { a = (long long)a * b % mod; }
int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) mul(ans, a);
    mul(a, a);
    b >>= 1;
  }
  return ans;
}
int n, k;
int a[N];
int arr[N], top = 0, zero = 0;
map<int, int> Map;
map<int, int>::iterator it;
int ifac[N], fac[N];
int f[2][N];
int binom(int x, int y) {
  return x < y ? 0 : Mul(fac[x], Mul(ifac[y], ifac[x - y]));
}
void init() {
  read(n);
  read(k);
  for (int i = 1; i <= n; ++i) read(a[i]);
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = Mul(fac[i - 1], i);
  ifac[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) ifac[i] = Mul(ifac[i + 1], i + 1);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    int t = a[i], ok = 1;
    while (t) {
      int num = t % 10;
      if (num != 4 && num != 7) ok = 0;
      t /= 10;
    }
    if (ok)
      Map[a[i]]++;
    else
      ++zero;
  }
  for (it = Map.begin(); it != Map.end(); ++it) arr[++top] = it->second;
}
void solve() {
  f[0][0] = 1;
  for (int i = 1; i <= top; ++i) {
    int now = i & 1, pre = now ^ 1;
    memset(f[now], 0, sizeof f[now]);
    for (int j = 0; j <= k; ++j) {
      add(f[now][j], f[pre][j]);
      if (j) add(f[now][j], Mul(arr[i], f[pre][j - 1]));
    }
  }
  int ans = 0;
  for (int i = 0; i <= k; ++i) {
    add(ans, Mul(f[top & 1][i], binom(zero, k - i)));
  }
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
