#include <bits/stdc++.h>
using namespace std;
const int MXN = 100001, mod = 1000000007;
vector<int64_t> factorial(MXN), inverse_factorial(MXN);
bool is_lucky(int64_t n) {
  while (n) {
    if (n % 10 != 4 and n % 10 != 7) {
      return false;
    }
    n /= 10;
  }
  return true;
}
int64_t power(int64_t x, int64_t n) {
  int64_t res = 1;
  while (n) {
    if (n & 1) {
      res = (res * x) % mod;
    }
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
int64_t nCr(int64_t n, int64_t r) {
  if (r > n or r < 0) {
    return 0;
  }
  int64_t res = 1;
  res *= factorial[n];
  res %= mod;
  res *= inverse_factorial[r];
  res %= mod;
  res *= inverse_factorial[n - r];
  res %= mod;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  factorial[0] = 1;
  inverse_factorial[0] = power(factorial[0], mod - 2);
  for (int64_t i = 1; i < 100001; i++) {
    factorial[i] = (factorial[i - 1] * i) % mod;
    inverse_factorial[i] = power(factorial[i], mod - 2);
  }
  int64_t n, k;
  cin >> n >> k;
  int64_t unlucky = 0;
  vector<int64_t> a(n), lucky_numbers;
  for (int64_t i = 0; i < n; i++) {
    cin >> a[i];
    if (is_lucky(a[i])) {
      lucky_numbers.emplace_back(a[i]);
    } else {
      unlucky++;
    }
  }
  sort(lucky_numbers.begin(), lucky_numbers.end());
  lucky_numbers.resize(unique(lucky_numbers.begin(), lucky_numbers.end()) -
                       lucky_numbers.begin());
  lucky_numbers.insert(lucky_numbers.begin(), 0);
  int64_t p = lucky_numbers.size();
  vector<int64_t> c(p + 1, 0);
  for (int64_t i = 0; i < n; i++) {
    if (is_lucky(a[i])) {
      auto x = lower_bound(lucky_numbers.begin(), lucky_numbers.end(), a[i]) -
               lucky_numbers.begin();
      c[x]++;
    }
  }
  vector<vector<int64_t>> dp(p + 1, vector<int64_t>(p + 1, 0));
  dp[0][0] = 1;
  for (int64_t i = 1; i <= p; i++) {
    dp[i][0] = 1;
    for (int64_t j = 1; j <= p; j++) {
      dp[i][j] = (dp[i - 1][j] + ((dp[i - 1][j - 1] * c[i]) % mod)) % mod;
    }
  }
  int64_t ways = 0;
  for (int64_t i = 0; i <= p; i++) {
    int64_t cur = (dp[p][i] * nCr(unlucky, k - i)) % mod;
    ways = (ways + cur) % mod;
  }
  cout << ways;
}
