#include <bits/stdc++.h>
typedef double (*dfun)(double, double);
const int K = 1030;
const int N = 1e5 + 10;
using namespace std;
const int MOD = 1e9 + 7;
long long binPow(long long x, int deg) {
  if (deg == 1) {
    return x;
  }
  long long mid = binPow(x, deg >> 1);
  long long a = (mid * mid) % MOD;
  if (deg & 1) {
    return (x * a) % MOD;
  }
  return a;
}
long long inv(long long x) {
  if (x <= 0) {
    return 0;
  }
  return binPow(x, MOD - 2);
}
int dp[2][N];
map<int, int> luckyCnt;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int tot = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    bool lucky = 1;
    int c = x;
    while (c > 0) {
      if ((c % 10 != 7) && (c % 10 != 4)) {
        lucky = 0;
        break;
      }
      c /= 10;
    }
    if (lucky) {
      luckyCnt[x]++;
      tot++;
    }
  }
  if (1030 + n - tot < k) {
    printf("0");
    return 0;
  }
  int p = 0;
  dp[0][0] = 1;
  for (int i = 1; i <= k; i++) {
    dp[0][i] = ((long long)dp[0][i - 1] * inv(i)) % MOD;
    dp[0][i] = ((long long)dp[0][i] * (n - tot - i + 1)) % MOD;
    if (n - tot - i + 1 < 0) {
      dp[0][i] = 0;
      break;
    }
  }
  for (auto it = luckyCnt.begin(); it != luckyCnt.end(); it++) {
    for (int i = 1; i <= k; i++) {
      dp[1][i] = ((long long)dp[0][i - 1] * it->second) % MOD;
      dp[1][i] = (dp[1][i] + dp[0][i]) % MOD;
    }
    for (int i = 1; i <= k; i++) {
      dp[0][i] = dp[1][i];
    }
  }
  printf("%d", dp[0][k]);
  return 0;
}
