#include <bits/stdc++.h>
using namespace std;
bool is_lucky(int x) {
  while (x) {
    if (x % 10 != 7 && x % 10 != 4) return false;
    x /= 10;
  }
  return true;
}
const int N = 100001;
const long long MOD = 1000000007;
long long a[N], f[N];
map<long long, int> luck;
long long qmod(long long a, long long b, long long c) {
  long long res = 1, tmp = a % c;
  while (b != 0) {
    if ((b & 1) != 0) res = (res * tmp) % c;
    b >>= 1;
    tmp = (tmp * tmp) % c;
  }
  return res;
}
long long inverse(long long x) { return qmod(x, MOD - 2, MOD); }
long long comb(int n, int m) {
  if (m > n) return 0;
  return ((f[n] * inverse(f[m])) % MOD) * inverse(f[n - m]) % MOD;
}
const int M = 1024;
long long c[M][M];
int main() {
  int n, k;
  ios::sync_with_stdio(false);
  f[0] = 1;
  for (int i = 1; i < int(N); ++i) f[i] = f[i - 1] * i % MOD;
  while (cin >> n >> k) {
    for (int i = 0; i < int(n); ++i) cin >> a[i];
    int un = n;
    luck.clear();
    for (int i = 0; i < int(n); ++i) {
      if (is_lucky(a[i])) {
        luck[a[i]]++;
        un--;
      }
    }
    memset(c, 0, sizeof(c));
    c[0][0] = 1;
    int cnt = 0;
    for (__typeof(luck.begin()) i = luck.begin(); i != luck.end(); ++i) {
      cnt++;
      c[cnt][0] = 1;
      for (int j = 1; j <= cnt; j++) {
        c[cnt][j] = (c[cnt - 1][j - 1] * i->second + c[cnt - 1][j]) % MOD;
      }
    }
    long long ans = 0;
    for (int i = 0; i <= un && i <= k; i++) {
      if (cnt >= k - i) {
        ans = (ans + comb(un, i) * c[cnt][k - i] % MOD) % MOD;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
