#include <bits/stdc++.h>
using namespace std;
int N, K, tot, luck, unluck;
long long Cl[2100], Cu[100010], R[2100], S[2100];
vector<int> Q;
bool isLucky(int x) {
  bool res = true;
  while (x) {
    int mm = x % 10;
    if (mm != 7 && mm != 4) {
      res = false;
      break;
    }
    x /= 10;
  }
  return res;
}
void add(int x) {
  tot++;
  bool hasX = false;
  for (int i = 0; i < Q.size(); i++)
    if (Q[i] == x) {
      hasX = true;
      S[i]++;
      break;
    }
  if (!hasX) {
    Q.push_back(x);
    S[Q.size() - 1] = 1;
  }
}
long long fac[100010], inv[100010];
long long power(long long x, int y) {
  long long res = 1;
  for (; y; y >>= 1, x = x * x % 1000000007)
    if (y & 1) res = res * x % 1000000007;
  return res;
}
long long C(int x, int y) {
  return 1ll * fac[x] * inv[y] % 1000000007 * inv[x - y] % 1000000007;
}
int main() {
  cin >> N >> K;
  tot = 0;
  memset(S, 0, sizeof(S));
  for (int i = 0, x; i < N; i++) {
    scanf("%d", &x);
    if (isLucky(x)) add(x);
  }
  luck = Q.size(), unluck = N - tot;
  memset(R, 0, sizeof(R));
  R[0] = 1;
  for (int i = 1; i <= luck; i++)
    for (int j = min(i, K); j >= 1; j--)
      R[j] = (R[j] + R[j - 1] * S[i - 1]) % 1000000007;
  fac[0] = 1;
  for (int i = 1; i <= N; i++) fac[i] = fac[i - 1] * i % 1000000007;
  for (int i = 0; i <= N; i++) inv[i] = power(fac[i], 1000000007 - 2);
  long long ans = 0;
  for (int ll = 0, uu; ll <= min(K, luck); ll++)
    if ((uu = K - ll) <= unluck)
      ans = (ans + (R[ll] * C(unluck, uu)) % 1000000007) % 1000000007;
  cout << ans << endl;
  return 0;
}
