#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
const int MOD = 1e9 + 7;
template <int SZ>
struct Combo {
  long long fac[SZ + 1], ifac[SZ + 1];
  Combo() {
    fac[0] = ifac[0] = 1;
    for (int i = (1); i < (SZ + 1); i++) {
      fac[i] = i * fac[i - 1] % MOD;
      ifac[i] = inv(fac[i]);
    }
  }
  long long po(long long b, long long p) {
    return !p ? 1 : po(b * b % MOD, p / 2) * (p & 1 ? b : 1) % MOD;
  }
  long long inv(long long b) { return po(b, MOD - 2); }
  long long comb(long long a, long long b) {
    if (a < b || b < 0 || a < 0) return 0;
    long long tmp = fac[a] * ifac[b] % MOD;
    tmp = tmp * ifac[a - b] % MOD;
    return tmp;
  }
};
Combo<100001> c;
int n, m;
map<int, int> num;
int a;
long long dp[N];
void upd(long long& a, long long b) {
  a = a + b;
  a %= MOD;
}
bool lucky(int t) {
  bool ok = 1;
  while (t) {
    int sb = t % 10;
    t /= 10;
    if (sb != 7 && sb != 4) ok = 0;
  }
  return ok;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (n); i++) {
    int t;
    scanf("%d", &t);
    if (lucky(t))
      num[t]++;
    else
      a++;
  }
  for (int i = (0); i < (m + 1); i++) dp[i] = c.comb(a, i);
  for (auto it : num) {
    for (int i = m; i; i--) upd(dp[i], dp[i - 1] * it.second);
  }
  printf("%lld\n", dp[m]);
  return 0;
}
