#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
const double dinf = 1e30;
const long long linf = 1LL << 55;
const long long MOD = 1000000007LL;
const int N = 111111;
map<int, int> lucky;
int n, k;
long long dp[1111][1111];
long long fac[N];
bool check(int x) {
  while (x) {
    int last = x % 10;
    if (last != 4 && last != 7) return false;
    x /= 10;
  }
  return true;
}
long long add(long long a, long long b) { return (a + b) % MOD; }
long long mul(long long a, long long b) { return (a * b) % MOD; }
long long power_mod(long long x, long long n) {
  long long res = 1;
  x %= MOD;
  while (n) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long C(long long n, long long k, long long MOD) {
  long long res = 1;
  if (k > n) return 0;
  res = fac[n] * power_mod(fac[n - k] * fac[k], MOD - 2) % MOD;
  return res;
}
long long Lucas(long long n, long long k, long long MOD) {
  if (k == 0) return 1;
  return C(n % MOD, k % MOD, MOD) * Lucas(n / MOD, k / MOD, MOD) % MOD;
}
int main() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = mul(fac[i - 1], i);
  while (cin >> n >> k) {
    lucky.clear();
    int cnt = 0;
    for (int i = 0, x; i < n; i++) {
      cin >> x;
      if (check(x))
        lucky[x]++;
      else
        cnt++;
    }
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= lucky.size(); i++) dp[0][i] = 1;
    for (int i = 1; i <= lucky.size(); i++) {
      int j = 0;
      for (map<int, int>::iterator it = lucky.begin(); it != lucky.end();
           it++) {
        j++;
        dp[i][j] = add(mul(dp[i - 1][j - 1], it->second), dp[i][j - 1]);
      }
    }
    long long ans = 0;
    for (int i = 0; i <= min(k, (int)lucky.size()); i++) {
      ans = add(ans, mul(dp[i][lucky.size()], Lucas(cnt, k - i, MOD)));
    }
    cout << ans << endl;
  }
  return 0;
}
