#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7, MAXN = 2e5 + 10;
map<int, int> m;
vector<int> v;
long long fact[MAXN], inv[MAXN], dp[2000][2000];
bool lucky(int x) {
  while (x) {
    if (x % 10 != 4 and x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long res = power(x, y / 2);
  res *= res;
  res %= Mod;
  if (y % 2) res *= x;
  return res % Mod;
}
long long C(int n, int r) {
  if (n < r) return 0;
  long long res = (fact[n] * inv[r]) % Mod;
  res *= inv[n - r];
  return res % Mod;
}
int main() {
  ios::sync_with_stdio(false);
  fact[0] = inv[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    fact[i] = (fact[i - 1] * i) % Mod;
    inv[i] = power(fact[i], Mod - 2);
  }
  int n, k, un = 0;
  cin >> n >> k;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (lucky(x))
      m[x]++;
    else
      un++;
  }
  map<int, int>::iterator it = m.begin();
  v.push_back(0);
  while (it != m.end()) {
    v.push_back((*it).second);
    it++;
  }
  dp[0][0] = 1;
  for (int i = 1; i < v.size(); i++) {
    dp[i][0] = 1;
    for (int j = 1; j <= i; j++)
      dp[i][j] = (dp[i - 1][j] + v[i] * dp[i - 1][j - 1]) % Mod;
  }
  int p = v.size() - 1;
  for (int i = 0; i <= p; i++) {
    ans += dp[p][i] * C(un, k - i);
    ans %= Mod;
  }
  cout << ans << endl;
  return 0;
}
