#include <bits/stdc++.h>
using namespace std;
const long long MODULUS = 1000000007LL;
long long logNExponentiation(long long val, unsigned long long exp) {
  long long a[64] = {val % MODULUS};
  for (int i = 1; i < 64; ++i) a[i] = a[i - 1] * a[i - 1] % MODULUS;
  long long res = 1LL;
  for (int i = 0; i < 64; ++i)
    if ((exp >> i) & 1) res = res * a[i] % MODULUS;
  return res;
}
long long modDivision(long long val, long long divisor) {
  return val * logNExponentiation(divisor, MODULUS - 2) % MODULUS;
}
long long factorials[100001];
long long combination(long long n, long long k) {
  return modDivision(factorials[n],
                     factorials[n - k] * factorials[k] % MODULUS);
}
bool isLucky(long long n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7) return false;
    n /= 10;
  }
  return true;
}
vector<pair<long long, int> > luckyFreq;
vector<vector<long long> > dp;
long long f(int n, int x) {
  if (dp[n][x] != -1) return dp[n][x];
  if (n < x || n < 0) return dp[n][x] = 0;
  if (x == 0) return dp[n][x] = 1;
  dp[n][x] = (f(n - 1, x) + (f(n - 1, x - 1) * luckyFreq[n].second % MODULUS)) %
             MODULUS;
  return dp[n][x];
}
int main() {
  long long n, k;
  cin >> n >> k;
  factorials[0] = 1;
  for (int i = 1; i <= n; ++i) factorials[i] = factorials[i - 1] * i % MODULUS;
  vector<long long> a(n);
  map<long long, int> luckyFreqMap;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int numOrdinary = 0;
  for (int i = 0; i < n; ++i) {
    if (isLucky(a[i]))
      luckyFreqMap[a[i]]++;
    else
      numOrdinary++;
  }
  map<long long, int>::iterator it = luckyFreqMap.begin(),
                                itEnd = luckyFreqMap.end();
  luckyFreq.emplace_back(0, 0);
  while (it != itEnd) {
    if (it->second > 1)
      luckyFreq.emplace_back(it->first, it->second);
    else
      numOrdinary++;
    it++;
  }
  int numUniqueLuckyNumbers = luckyFreq.size() - 1;
  dp.resize(numUniqueLuckyNumbers + 1);
  dp[0].resize(dp.size(), 0);
  dp[0][0] = 1;
  for (int i = 1; i <= numUniqueLuckyNumbers; ++i) {
    dp[i].resize(dp.size(), -1);
  }
  for (int i = 1; i <= numUniqueLuckyNumbers; ++i)
    for (int j = 0; j <= i; ++j) f(i, j);
  long long res = 0LL;
  int maxOrdinary = min((int)k, numOrdinary);
  for (int ordinaryToSelect = 0; ordinaryToSelect <= maxOrdinary;
       ++ordinaryToSelect) {
    long long ordinaryCoeff = combination(numOrdinary, ordinaryToSelect);
    int remaining = k - ordinaryToSelect;
    if (remaining <= numUniqueLuckyNumbers) {
      long long val =
          ordinaryCoeff * dp[numUniqueLuckyNumbers][remaining] % MODULUS;
      res = (res + val) % MODULUS;
    }
  }
  cout << res << endl;
  return 0;
}
