#include <bits/stdc++.h>
using namespace std;
int n, k;
long long a[100010];
long long c[100010];
int l[1100];
long long dp[1100][1100];
map<long long, int> ind;
int m;
long long next(long long t) {
  vector<int> v;
  while (t > 0) {
    v.push_back(t % 10);
    t /= 10;
  }
  int r = 1;
  for (int i = 0; i < v.size(); i++) {
    if (r == 1) {
      if (v[i] == 4) {
        v[i] = 7;
        r = 0;
      } else {
        v[i] = 4;
      }
    } else
      break;
  }
  if (r == 1) v.push_back(4);
  long long f = 1;
  t = 0;
  for (int i = 0; i < v.size(); i++) {
    t += f * v[i];
    f *= 10;
  }
  return t;
}
long long solve(int p, int q) {
  if (p == 0 && q == 0) return 1;
  if (q < 0) return 0;
  if (p == 0) return 0;
  if (dp[p][q] != -1) return dp[p][q];
  long long res =
      ((solve(p - 1, q - 1) * l[p - 1]) % 1000000007 + solve(p - 1, q)) %
      1000000007;
  dp[p][q] = res;
  return res;
}
long long fast_pow(long long a, long long b) {
  if (b == 0) return 1LL;
  if (b == 1) return a;
  long long tmp = fast_pow(a, b / 2) % 1000000007;
  if (b % 2 == 0) return tmp * tmp % 1000000007;
  return (a * ((tmp * tmp) % 1000000007)) % 1000000007;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  long long t = 4;
  m = 0;
  while (t <= 1000000000LL) {
    ind[t] = m++;
    t = next(t);
  }
  for (int i = 0; i < m; i++) l[i] = 0;
  for (int i = 0; i < n; i++)
    if (ind.find(a[i]) != ind.end()) l[ind[a[i]]]++;
  for (int i = 0; i <= m; i++)
    for (int j = 0; j <= m; j++) dp[i][j] = -1;
  for (int i = 0; i <= m; i++) solve(m, i);
  long long tmp = 0;
  for (int i = 0; i < n; i++)
    if (ind.find(a[i]) == ind.end()) tmp++;
  c[0] = 1;
  for (int i = 0; i <= k; i++) {
    c[i + 1] = ((c[i] * (tmp - i) % 1000000007) *
                fast_pow(i + 1, 1000000007 - 2) % 1000000007) %
               1000000007;
    if (i >= tmp) c[i] = 1;
  }
  long long res = 0;
  for (int i = 0; i <= m; i++) {
    if (i <= k && (k - i) <= tmp)
      res = (res + (c[k - i] * dp[m][i] % 1000000007)) % 1000000007;
  }
  cout << res << endl;
  return 0;
}
