#include <bits/stdc++.h>
using namespace std;
vector<long long> lucky;
map<long long, long long> luck;
long long fact[100005];
long long dp[1025][1025];
long long cnt[1025] = {};
long long md = 1e9 + 7;
int n, k;
int ccnt = 0;
void generate_lucky(int x, long long y) {
  if (x == 9) return;
  lucky.push_back(y * 10 + 4);
  generate_lucky(x + 1, y * 10 + 4);
  lucky.push_back(y * 10 + 7);
  generate_lucky(x + 1, y * 10 + 7);
  ccnt += 2;
}
void prec() {
  generate_lucky(0, 0);
  sort(lucky.begin(), lucky.end());
  for (int i = 0; i < lucky.size(); i++) {
    luck[lucky[i]] = i + 1;
  }
  fact[0] = fact[1] = 1;
  for (long long i = 2; i <= 100000; i++) {
    fact[i] = (fact[i - 1] * i) % md;
  }
  for (int i = 0; i <= 1024; i++)
    for (int j = 0; j <= 1024; j++) dp[i][j] = -1;
}
long long fast(long long x, long long n) {
  if (n == 0) return 1;
  long long ret = fast(x, n / 2);
  ret *= ret;
  ret %= md;
  if (n % 2 == 1) {
    ret *= x;
    ret %= md;
  }
  return ret;
}
long long comb(long long n, long long r) {
  return (((fact[n] * fast(fact[r], md - 2)) % md) *
          fast(fact[n - r], md - 2)) %
         md;
}
long long rec(int x, int y) {
  if (y == 0) return 1;
  if (x == 1023) return 0;
  if (dp[x][y] != -1) return dp[x][y];
  return dp[x][y] = (rec(x + 1, y) + (cnt[x] * (rec(x + 1, y - 1))) % md) % md;
}
int main() {
  prec();
  cin >> n >> k;
  int other = 0;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (luck[x] != 0)
      cnt[luck[x]]++;
    else
      other++;
  }
  long long ans = 0;
  for (int i = 0; i <= min(k, other); i++) {
    if (k - i > 1022) continue;
    long long asd = rec(1, k - i);
    ans += (comb(other, i) * rec(1, k - i)) % md;
    ans %= md;
  }
  cout << ans;
}
