#include <bits/stdc++.h>
using namespace std;
long long f[100001];
void fact(long long MOD) {
  f[0] = 1;
  f[1] = 1;
  for (long long i = 2; i <= 100000; i++) f[i] = (f[i - 1] * i) % MOD;
}
long long pow(long long a, long long b, long long MOD) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > MOD) x %= MOD;
    }
    y = (y * y);
    if (y > MOD) y %= MOD;
    b /= 2;
  }
  return x;
}
long long InverseEuler(long long n, long long MOD) {
  return pow(n, MOD - 2, MOD);
}
long long C(long long n, long long r, long long MOD) {
  return (f[n] *
          ((InverseEuler(f[r], MOD) * InverseEuler(f[n - r], MOD)) % MOD)) %
         MOD;
}
bool lucky(int n) {
  while (n > 0) {
    if (n % 10 == 4 || n % 10 == 7) {
      n /= 10;
      continue;
    } else
      return 0;
  }
  return 1;
}
int main() {
  long long mod = 1000000007;
  fact(mod);
  int n, k, unlucky = 0, x, arr[1024], no = 0, dp[1024][1024] = {{0}};
  map<int, int> m;
  map<int, int>::iterator it;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (lucky(x)) {
      m[x]++;
    } else
      unlucky++;
  }
  for (it = m.begin(); it != m.end(); it++) {
    if (it->second) {
      arr[++no] = (it->second);
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i <= no; i++) {
    dp[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      dp[i][j] = dp[i - 1][j] + ((long long)dp[i - 1][j - 1] * arr[i]) % mod;
      dp[i][j] %= mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= no; i++) {
    if (k < i) break;
    if (unlucky < k - i) continue;
    long long x = C(unlucky, k - i, mod);
    x *= (long long)dp[no][i];
    x %= mod;
    ans += x;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
