#include <bits/stdc++.h>
long long mpow(long long a, long long n, long long mod) {
  long long ret = 1;
  long long b = a;
  while (n) {
    if (n & 1) ret = (ret * b) % mod;
    b = (b * b) % mod;
    n >>= 1;
  }
  return (long long)ret;
}
using namespace std;
int a[100000 + 5];
map<int, int> ind;
long long cnt[1500];
long long dp[1400][1400];
long long fact[100000 + 5];
long long inv[100000 + 5];
void computefact() {
  fact[0] = 1;
  inv[0] = 1;
  long long i, j;
  for (j = 1; j < 100000 + 5; j++) {
    fact[j] = (fact[j - 1] * j) % 1000000007;
    inv[j] = mpow(fact[j], 1000000007 - 2, 1000000007);
  }
}
long long ncr(long long n, long long r) {
  long long den = (inv[r] * inv[n - r]) % 1000000007;
  long long num = (fact[n] * den) % 1000000007;
  return num;
}
bool chk(int x) {
  while (x != 0) {
    int p = x % 10;
    if (!(p == 4 || p == 7)) {
      return 0;
    }
    x /= 10;
  }
  return 1;
}
int main() {
  int i, j;
  vector<int> luck;
  long long n, len;
  cin >> n >> len;
  long long unl = 0;
  int c = 1;
  computefact();
  for (j = 0; j < n; j++) {
    cin >> a[j];
    if (chk(a[j])) {
      if (!ind[a[j]]) {
        luck.push_back(a[j]);
        ind[a[j]] = c;
        cnt[c]++;
        c++;
      } else {
        cnt[ind[a[j]]]++;
      }
    } else
      unl++;
  }
  dp[0][0] = 1;
  int sz = luck.size();
  for (i = 1; i <= sz; i++) {
    for (j = 0; j <= sz; j++) {
      dp[i][j] = (dp[i - 1][j] + (dp[i - 1][j - 1] * cnt[i]) % 1000000007) %
                 1000000007;
    }
  }
  long long ans = 0;
  for (long long k = 0; k <= min(len, unl); k++) {
    long long q = len - k;
    if (q > sz) continue;
    ans = (ans + (ncr(unl, k) * dp[sz][q]) % 1000000007) % 1000000007;
  }
  cout << ans;
  return 0;
}
