#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
int mas[100001];
int fac[100001], ifac[100001];
vector<int> v;
int dp[1501][1501];
inline bool good(int a) {
  if (!a) return 1;
  if (a % 10 != 4 && a % 10 != 7) return 0;
  return good(a / 10);
}
inline void add(int &a, int b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
inline int ce(int n, int k) {
  if (k > n) return 0;
  long long a = (long long)fac[n] * ifac[k] % 1000000007;
  return a * ifac[n - k] % 1000000007;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    scanf("%d", &mas[i]);
  }
  sort(mas, mas + n);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    if (i && mas[i] == mas[i - 1]) continue;
    if (!good(mas[i])) continue;
    a = i;
    while (a < n && mas[a] == mas[i]) ++a;
    v.push_back(a - i);
  }
  c = 0;
  for (int _n((n)-1), i(0); i <= _n; i++)
    if (!good(mas[i])) ++c;
  dp[0][0] = 1;
  for (int _n(((int)((v).size())) - 1), i(0); i <= _n; i++) {
    for (int _n(((int)((v).size()) + 1) - 1), j(0); j <= _n; j++) {
      if (!dp[i][j]) continue;
      add(dp[i + 1][j], dp[i][j]);
      add(dp[i + 1][j + 1], (long long)dp[i][j] * v[i] % 1000000007);
    }
  }
  fac[0] = 1;
  ifac[0] = 1;
  for (int _n((100000)), i(1); i <= _n; i++) {
    fac[i] = ((long long)fac[i - 1] * i) % 1000000007;
    ifac[i] = 1000000007 -
              (long long)(1000000007 / i) * ifac[1000000007 % i] % 1000000007;
    if (ifac[i] >= 1000000007) ifac[i] -= 1000000007;
    if (ifac[i] < 0) ifac[i] += 1000000007;
    if (i == 1) ifac[i] = 1;
  }
  for (int _n((100000)), i(1); i <= _n; i++) {
    ifac[i] = ((long long)ifac[i - 1] * ifac[i]) % 1000000007;
  }
  int ans = 0;
  for (int _n(((int)((v).size()) + 1) - 1), i(0); i <= _n; i++) {
    if (i > k) break;
    int need = k - i;
    if (need > c) continue;
    add(ans, (long long)dp[(int)((v).size())][i] * ce(c, need) % 1000000007);
  }
  printf("%d\n", ans);
}
