#include <bits/stdc++.h>
using namespace std;
const int maxtop = 1025;
const int maxn = 100010;
const int mo = 1000000007;
int top;
int repeat[maxtop + 1];
int rest;
int a[maxn + 1];
int n, K;
int C[maxn + 1];
int f[2][maxtop + 1], old, now;
long long result;
void init() {
  int i;
  scanf("%d%d", &n, &K);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
}
bool lucky(int x) {
  int t;
  while (x) {
    t = x % 10;
    if ((t != 4) && (t != 7)) return false;
    x /= 10;
  }
  return true;
}
void calc_repeat() {
  int i, j;
  top = rest = 0;
  i = 1;
  while (i <= n) {
    if (lucky(a[i])) {
      j = i;
      while ((j + 1 <= n) && (a[j + 1] == a[i])) ++j;
      repeat[++top] = j - i + 1;
      i = j + 1;
    } else {
      ++rest;
      ++i;
    }
  }
}
int power(int x, int y) {
  long long a, b;
  b = x;
  a = 1;
  while (y) {
    if (y & 1) a = (a * b) % mo;
    b = (b * b) % mo;
    y = (y >> 1);
  }
  return a;
}
void calc_C() {
  int i;
  long long tmp;
  C[0] = 1;
  if (rest == 0) return;
  C[1] = rest;
  for (i = 2; i <= rest; ++i) {
    tmp = C[i - 1];
    tmp = (tmp * (rest - i + 1)) % mo;
    tmp = (tmp * power(i, mo - 2)) % mo;
    C[i] = tmp;
  }
}
void calc_result() {
  int i, j, k;
  long long tmp;
  now = 0;
  for (i = 1; i <= top; ++i) f[now][i] = 0;
  f[now][0] = 1;
  for (i = 1; i <= top; ++i) {
    old = now;
    now = 1 - now;
    f[now][0] = 1;
    for (j = 1; j <= i; ++j) {
      if (j > K) break;
      f[now][j] = 0;
      if (j < i) f[now][j] += f[old][j];
      tmp = f[old][j - 1];
      tmp = (tmp * repeat[i]) % mo;
      f[now][j] = (f[now][j] + tmp) % mo;
    }
  }
  result = 0;
  for (i = 0; i <= top; ++i) {
    if (i > K) break;
    if (K - i > rest) continue;
    tmp = f[now][i];
    tmp = (tmp * C[K - i]) % mo;
    result += tmp;
    if (result >= mo) result -= mo;
  }
}
void work() {
  calc_repeat();
  calc_C();
  calc_result();
}
void output() { printf("%d\n", result); }
int main() {
  init();
  work();
  output();
  return 0;
}
