#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double eps = 1e-9;
const int maxn = (int)1e5 + 10;
const long long MOD = (long long)1e9 + 7;
int lucky(int x) {
  while (x > 0) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
long long binpow(long long a, long long b) {
  if (b == 0) return 1LL;
  long long res = binpow(a, b / 2);
  res = (res * res) % MOD;
  if (b % 2 == 1) res = (res * a) % MOD;
  return res;
}
long long d[1111][1111], fact[maxn], ob[maxn];
long long c(int n, int k) {
  if (n < k) return 0LL;
  if (n == k || k == 0) return 1LL;
  return (((fact[n] * ob[k]) % MOD) * ob[n - k]) % MOD;
}
int main() {
  fact[0] = 1LL;
  for (int i = 1; i < maxn; i++) fact[i] = (fact[i - 1] * i) % MOD;
  for (int i = 1; i < maxn; i++) ob[i] = binpow(fact[i], MOD - 2);
  int n, k, x, no = 0;
  cin >> n >> k;
  map<int, int> dd;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (lucky(x))
      dd[x]++;
    else
      no++;
  }
  vector<int> v;
  for (map<int, int>::iterator it = dd.begin(); it != dd.end(); it++)
    v.push_back(it->second);
  for (int i = 0; i < 1111; i++)
    for (int j = 0; j < 1111; j++) d[i][j] = 0;
  for (int i = 0; i < 1111; i++) d[i][0] = 1;
  for (int i = 1; i <= (int)(v).size(); i++)
    for (int j = 1; j <= i; j++)
      d[i][j] = (d[i - 1][j] + ((d[i - 1][j - 1] * v[i - 1]) % MOD)) % MOD;
  for (int i = 0; i <= (int)(v).size(); i++)
    for (int j = i + 1; j < 1111; j++) assert(d[i][j] == 0);
  assert((int)(v).size() < 1111);
  long long res = 0;
  for (int i = 0; i <= k && i <= (int)(v).size(); i++)
    res = (res + ((c(no, k - i) * d[(int)(v).size()][i]) % MOD)) % MOD;
  cout << res << endl;
  return 0;
}
