#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
long long a[MAXN];
long long num[1 << 11];
long long dp[1 << 11][1 << 11], factorial[MAXN];
void PreWork() {
  factorial[0] = 1LL;
  for (long long i = 1; i <= 100000; i++)
    factorial[i] = (factorial[i - 1] * i) % 1000000007;
  return;
}
void Ex_Gcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return;
  }
  Ex_Gcd(b, a % b, x, y);
  long long t;
  t = x, x = y, y = t - a / b * y;
  return;
}
long long C(long long a, long long b) {
  long long x, y;
  if (b > a) return 0;
  b = (factorial[b] * factorial[a - b]) % 1000000007;
  a = factorial[a];
  Ex_Gcd(b, 1000000007, x, y);
  a = (a * x) % 1000000007;
  if (a < 0) a += 1000000007;
  return a;
}
bool lucky(long long num) {
  if (num == 0) return false;
  while (num > 0) {
    if (num % 10 == 4 || num % 10 == 7) {
      num /= 10;
    } else
      return false;
  }
  return true;
}
int main() {
  long long m, n, i, j, k;
  PreWork();
  scanf("%I64d%I64d", &m, &n);
  for (i = 1; i <= m; i++) scanf("%I64d", &a[i]);
  long long tot = 0, tot2 = 0;
  map<long long, long long> mp;
  for (i = 1; i <= m; i++) {
    if (lucky(a[i])) {
      if (mp[a[i]] == 0) num[++tot] = a[i];
      mp[a[i]]++;
      tot2++;
    }
  }
  for (i = 1; i <= tot; i++) num[i] = mp[num[i]];
  for (i = 0; i <= tot; i++) dp[i][0] = 1;
  for (i = 1; i <= tot; i++) {
    for (j = 1; j <= i; j++) {
      dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1] * num[i]) % 1000000007;
    }
  }
  long long ans = 0;
  for (i = 0; i <= min(tot2, n); i++) {
    ans = (ans + dp[tot][i] * C(m - tot2, n - i)) % 1000000007;
  }
  cout << ans << endl;
}
