#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000 + 10;
const int MOD = 1000000007;
int x, y;
int N, K, M;
int tot;
int a[MAX_N];
int w[MAX_N];
long long f[2][MAX_N];
int Check_Lucky(int x) {
  while (x) {
    if (x % 10 != 7 && x % 10 != 4) return 0;
    x /= 10;
  }
  return 1;
}
void Init() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + N + 1);
  for (int i = 1; i <= N; ++i)
    if ((i == 1 || a[i] != a[i - 1]) && Check_Lucky(a[i])) {
      ++tot;
      w[tot]++;
      while (i < N && a[i] == a[i + 1]) {
        ++w[tot];
        ++i;
      }
    } else
      ++M;
}
void Ex_Gcd(long long a, long long b) {
  if (!b) {
    x = 1;
    y = 0;
    return;
  }
  Ex_Gcd(b, a % b);
  long long tmp = x;
  x = y;
  y = tmp - a / b * y;
}
long long Get_Anti(long long a) {
  Ex_Gcd(a, MOD);
  if (x < 0) x += MOD;
  return x;
}
void Div(long long &t, int p) {
  long long anti = Get_Anti(p);
  t = t * anti % MOD;
}
void Calc() {
  f[0][0] = 1;
  for (int i = 1; i <= min(K, M); ++i) {
    f[0][i] = f[0][i - 1] * (M - i + 1) % MOD;
    Div(f[0][i], i);
  }
}
void Solve() {
  Calc();
  int now = 0, pre;
  for (int i = 1; i <= tot; ++i) {
    pre = now;
    now ^= 1;
    f[now][0] = 1;
    for (int j = 1; j <= K; ++j)
      f[now][j] = (f[pre][j] + f[pre][j - 1] * w[i]) % MOD;
  }
  cout << f[now][K] << endl;
}
int main() {
  Init();
  Solve();
  return 0;
}
