#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long N = 100005;
long long fact[N] = {0};
long long n, k, u = 0, num;
map<long long, long long> m;
map<long long, long long>::iterator it;
vector<long long> v;
long long dp[2000][2000];
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b % 2 == 1) ans *= a;
    b /= 2;
    a *= a;
    a %= mod;
    ans %= mod;
  }
  return ans;
}
int absv(int val) {
  if (val < 0) val *= -1;
  return val;
}
long long modinv(long long a, long long b) {
  long long ans = fact[a] * fact[b];
  ans %= mod;
  return power(ans, mod - 2);
}
long long nCr(long long n, long long r) {
  long long ans = 1;
  ans *= fact[n];
  ans *= modinv(n - r, r);
  ans %= mod;
  return ans;
}
void factinit() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
}
bool islucky(long long n) {
  int flag = 0;
  while (n) {
    long long dig = n % 10;
    if (dig != 4 && dig != 7) {
      flag = 1;
      break;
    }
    n /= 10;
  }
  return flag == 0;
}
void createdp() {
  for (it = m.begin(); it != m.end(); it++) {
    v.push_back((*it).second);
  }
  num = v.size();
  for (int i = 0; i <= num; i++)
    for (int j = 0; j <= num; j++) dp[i][j] = 0;
  for (int j = 0; j <= num; j++) dp[0][j] = 1;
  for (int i = 1; i <= num; i++) {
    for (int j = 1; j <= num; j++) {
      dp[i][j] = dp[i - 1][j - 1] * v[j - 1] + dp[i][j - 1];
      dp[i][j] %= mod;
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> k;
  factinit();
  for (int i = 0; i < n; i++) {
    long long tmp;
    cin >> tmp;
    if (islucky(tmp))
      m[tmp]++;
    else
      u++;
  }
  createdp();
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    if (i <= num && u >= k - i) ans += nCr(u, k - i) * dp[i][num];
    ans %= mod;
  }
  cout << ans << endl;
}
