#include <bits/stdc++.h>
using namespace std;
inline bool islucky(int a) {
  while (a) {
    if (a % 10 != 4 && a % 10 != 7) return false;
    a /= 10;
  }
  return true;
}
const int mod = 1000000007;
namespace math_C {
const int maxnum = 200000 + 5;
int frac[maxnum];
inline void init_frac() {
  frac[0] = 1;
  for (int i = 1; i < maxnum; ++i) frac[i] = frac[i - 1] * 1LL * i % mod;
}
void exgcd(int a, int b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
  } else {
    long long x1, y1;
    exgcd(b, a % b, x1, y1);
    x = y1, y = x1 - (a / b) * y1;
  }
}
inline int inv(int a) {
  long long x, y;
  exgcd(a, mod, x, y);
  return (x % mod + mod) % mod;
}
inline int C(int a, int b) {
  if (b > a)
    return 0;
  else
    return frac[a] * 1LL * inv(frac[b] * 1LL * frac[a - b] % mod) % mod;
}
}  // namespace math_C
using math_C::C;
const int maxn = 100000 + 5;
int n, k;
int f[maxn];
int main() {
  math_C::init_frac();
  map<int, int> lucky_num_cnt;
  scanf("%d%d", &n, &k);
  int unlucky_cnt = 0;
  for (int i = 1; i <= n; ++i) {
    int a;
    scanf("%d", &a);
    if (islucky(a))
      ++lucky_num_cnt[a];
    else
      ++unlucky_cnt;
  }
  for (int i = 0; i <= k; ++i) f[i] = C(unlucky_cnt, i);
  int nbd = max(0, k - (int)lucky_num_cnt.size() - 10);
  for (map<int, int>::iterator it = lucky_num_cnt.begin();
       it != lucky_num_cnt.end(); ++it) {
    for (int i = k; i > nbd; --i)
      f[i] = (f[i] + 0LL + f[i - 1] * 1LL * it->second % mod) % mod;
  }
  printf("%d\n", f[k]);
  return 0;
}
