#include <bits/stdc++.h>
using namespace std;
int cnt[1024];
int lucky[1024];
int kol = 0;
long long dp[1024];
long long ce[100005];
long long rev[100005];
void gen(int val, int lev) {
  if (!lev) {
    if (val) {
      lucky[kol++] = val;
    }
    return;
  }
  if (!val) {
    gen(val, lev - 1);
  }
  gen(val * 10 + 4, lev - 1);
  gen(val * 10 + 7, lev - 1);
}
int main() {
  rev[1] = 1;
  for (int i = 2; i < 100005; ++i) {
    rev[i] =
        (1000000007 - (1000000007 / i) * rev[1000000007 % i] % 1000000007) %
        1000000007;
  }
  gen(0, 9);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int cur;
    cin >> cur;
    bool found = false;
    for (int j = 0; j < kol; ++j) {
      if (lucky[j] == cur) {
        ++cnt[j];
        found = true;
        break;
      }
    }
    if (!found) {
      ++cnt[kol];
    }
  }
  dp[0] = 1;
  for (int i = 0; i < kol; ++i) {
    for (int j = 1023; j; --j) {
      dp[j] = (dp[j] + dp[j - 1] * cnt[i]) % 1000000007;
    }
  }
  ce[0] = 1;
  for (int i = 1; i <= cnt[kol]; ++i) {
    ce[i] =
        ((ce[i - 1] * (cnt[kol] - i + 1)) % 1000000007 * rev[i]) % 1000000007;
  }
  long long ret = 0;
  for (int i = 0; i <= min(k, kol); ++i) {
    ret += dp[i] * ce[k - i];
    ret %= 1000000007;
  }
  cout << ret << endl;
  return 0;
}
