#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a %= mod;
}
inline int mul(int a, int b) { return (1LL * a * b) % mod; }
int n, k, sz;
map<int, int> mp;
vector<int> cnt;
int dp[2000];
int fact[112345];
int inv(int x) {
  int p = mod - 2;
  int ret = 1;
  while (p) {
    if (p & 1) ret = (1LL * ret * x) % mod;
    x = mul(x, x);
    p >>= 1;
  }
  return ret;
}
int comb(int n, int k) {
  if (k > n)
    return 0;
  else if (k == n)
    return 1;
  return mul(fact[n], mul(inv(fact[k]), inv(fact[n - k])));
}
bool is_lucky(int x) {
  while (x) {
    int d = x % 10;
    if (d != 4 && d != 7) return false;
    x /= 10;
  }
  return true;
}
int MAIN() {
  int other = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    int d;
    scanf("%d", &d);
    if (is_lucky(d)) {
      if (!mp.count(d)) {
        mp[d] = sz++;
        cnt.push_back(0);
      }
      ++cnt[mp[d]];
    } else {
      ++other;
    }
  }
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= n; ++i) {
    fact[i] = mul(i, fact[i - 1]);
  }
  dp[0] = 1;
  for (int i = 1; i <= sz; ++i) {
    for (int j = sz; j >= 1; --j) {
      add(dp[j], mul(dp[j - 1], cnt[i - 1]));
    }
  }
  int tot = 0;
  for (int i = 0; i <= min(k, sz); ++i) {
    add(tot, mul(dp[i], comb(other, k - i)));
  }
  printf("%d\n", tot);
  return 0;
}
int main() {
  MAIN();
  return 0;
}
