#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const long long mod = 1e9 + 7;
int n, k, m;
map<int, int> id;
int num[maxn];
int unlucky;
long long quick_pow(long long a, long long p, long long n) {
  long long ret = 1;
  while (p) {
    if (p % 2 == 1) ret = ret * a % n;
    a = a * a % n;
    p /= 2;
  }
  return ret;
}
bool isLucky(int x) {
  while (x != 0) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
long long dp[2][maxn];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int temp;
    scanf("%d", &temp);
    if (isLucky(temp)) {
      if (!id[temp]) {
        id[temp] = ++m;
      }
      num[id[temp]]++;
    } else
      ++unlucky;
  }
  dp[1][0] = 1;
  for (int i = 1; i <= unlucky; i++) {
    dp[1][i] = dp[1][i - 1] * (unlucky - i + 1) % mod *
               quick_pow(i, mod - 2, mod) % mod;
  }
  for (int i = 1; i <= m; i++) {
    int ori = i % 2, now = ori ^ 1;
    memset(dp[now], 0, sizeof(dp[now]));
    dp[now][0] = 1;
    for (int j = 1; j <= k; j++) {
      dp[now][j] = (dp[ori][j - 1] * num[i] + dp[ori][j]) % mod;
    }
  }
  printf("%I64d\n", dp[(m + 1) % 2][k]);
}
