#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, maxn = 100005;
int fact[maxn], inv[maxn];
void init(int n = 1e5) {
  fact[0] = 1;
  for (int i = 1; i <= n; i++)
    fact[i] = (long long)i * fact[i - 1] % 1000000007;
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = 1000000007 -
             (long long)(1000000007 / i) * inv[1000000007 % i] % 1000000007;
  inv[0] = 1;
  for (int i = 1; i <= n; i++)
    inv[i] = (long long)inv[i - 1] * inv[i] % 1000000007;
}
int C(int n, int m) {
  return (long long)fact[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
int n, k, a[maxn], num[maxn], dp[1100][1100];
bool check(int n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7) return 0;
    n /= 10;
  }
  return 1;
}
int main() {
  init();
  while (~scanf("%d%d", &n, &k)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    int sum = 0, res = 0;
    for (int i = 1; i <= n; i++) {
      int j = i;
      while (j < n && a[j] == a[j + 1]) j++;
      if (check(a[i]))
        num[++res] = j - i + 1;
      else
        sum += j - i + 1;
      i = j;
    }
    dp[0][0] = 1;
    for (int i = 1; i <= res; i++)
      for (int j = 0; j <= i; j++) {
        dp[i][j] = dp[i - 1][j];
        if (j) {
          dp[i][j] += (long long)num[i] * dp[i - 1][j - 1] % 1000000007;
          if (dp[i][j] >= 1000000007) dp[i][j] -= 1000000007;
        }
      }
    int ans = 0;
    for (int i = 0; i <= min(sum, k); i++)
      if (k - i <= res) {
        ans += (long long)C(sum, i) * dp[res][k - i] % 1000000007;
        if (ans >= 1000000007) ans -= 1000000007;
      }
    printf("%d\n", ans);
  }
  return 0;
}
