#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1000000000")
long long binpo(long long a, long long b) {
  if (b == 0) return 1;
  long long c = binpo(a, b / 2);
  if (b & 1) return c * c % (long long)1000000007 * a % (long long)1000000007;
  return c * c % (long long)1000000007;
}
long long bk(long long n, long long k) {
  if (n < 0 || k > n || k < 0) return 0;
  if (n - k < k) return bk(n, n - k);
  long long a = 1, b = 1;
  for (long long i = n - k + 1; i <= n; ++i) a = a * i % (long long)1000000007;
  for (long long i = 1; i <= k; ++i) b = b * i % (long long)1000000007;
  return a * binpo(b, (long long)1000000007 - 2) % (long long)1000000007;
}
bool chk(long long n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7) return 0;
    n /= 10;
  }
  return 1;
}
static long long m1[1000000], m2[1000000], m3[1200];
static vector<long long> vc;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, al = 0;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> m1[i];
    if (chk(m1[i])) vc.push_back(m1[i]);
  }
  al = vc.size();
  sort(vc.begin(), vc.end());
  vc.resize(unique(vc.begin(), vc.end()) - vc.begin());
  for (int i = 0; i < n; ++i)
    if (chk(m1[i])) {
      m2[lower_bound(vc.begin(), vc.end(), m1[i]) - vc.begin()]++;
    }
  m3[0] = 1;
  for (int i = 0; i < vc.size(); ++i) {
    for (int j = i; j >= 0; --j)
      m3[j + 1] = (m3[j + 1] + m3[j] * m2[i]) % (long long)1000000007;
  }
  long long res = 0;
  for (int i = 0; i <= vc.size(); ++i)
    res = (res + m3[i] * bk(n - al, k - i)) % (long long)1000000007;
  cout << res << endl;
  return 0;
}
