#include <bits/stdc++.h>
long long int fast_pow(long long int base, long long int exp) {
  base %= 1000000007;
  if (exp == 0) return 1;
  if (exp == 1) return base % 1000000007;
  long long int t = fast_pow(base, exp / 2);
  t = ((t % 1000000007) * (t % 1000000007)) % 1000000007;
  if (exp % 2 == 0)
    return t;
  else
    return ((base % 1000000007) * t) % 1000000007;
}
using namespace std;
const long long int N = 1e5 + 5;
long long int fac[N], inv[N];
void prep() {
  fac[0] = 1;
  inv[0] = 1;
  for (long long int i = 1; i < N; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = fast_pow(fac[i], 1000000007 - 2);
  }
}
long long int ncr(long long int n, long long int k) {
  if (n < 0 || k < 0 || k > n) return 0;
  return (((fac[n] * inv[k]) % 1000000007) * inv[n - k] % 1000000007) %
         1000000007;
}
bool lucky(long long int n) {
  while (n != 0) {
    long long int dig = n % 10;
    if (dig != 4 && dig != 7) return false;
    n /= 10;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  prep();
  vector<long long int> vec(n);
  for (long long int i = 0; i <= n - 1; i++) cin >> vec[i];
  long long int normal = 0;
  set<long long int> s;
  map<long long int, long long int> cntr;
  for (long long int i = 0; i <= n - 1; i++) {
    if (lucky(vec[i])) {
      s.insert(vec[i]);
      cntr[vec[i]]++;
    } else
      normal++;
  }
  vector<long long int> arr;
  for (auto i : s) arr.push_back(i);
  long long int n2 = arr.size();
  if (n2 == 0) {
    cout << ncr(normal, k) % 1000000007;
    return 0;
  }
  vector<vector<long long int> > dp(3, vector<long long int>(k + 1, 0));
  for (long long int i = 0; i <= n2 - 1; i++) dp[(i + 3) % 3][0] = 1;
  dp[0][1] = cntr[arr[0]];
  for (long long int i = 1; i <= n2 - 1; i++) {
    for (long long int j = 1; j <= k; j++) {
      if (j > i + 1)
        dp[(i + 3) % 3][j] = 0;
      else
        dp[(i + 3) % 3][j] =
            (dp[(i - 1 + 3) % 3][j] +
             (dp[(i - 1 + 3) % 3][j - 1] * cntr[arr[i]]) % 1000000007) %
            1000000007;
    }
  }
  long long int ans = 0;
  for (long long int j = 0; j <= k; j++)
    ans = (ans + (dp[(n2 - 1 + 3) % 3][j] * ncr(normal, k - j)) % 1000000007) %
          1000000007;
  cout << ans << '\n';
  return 0;
}
