#include <bits/stdc++.h>
using namespace std;
int b = 1000000007;
bool pr(int first) {
  while (first > 0) {
    int r = first % 10;
    if (r != 4 && r != 7) return 0;
    first = first / 10;
  }
  return 1;
}
long long fakt[100100];
int mas[100100];
map<int, int> m;
long long power(int a, int t) {
  if (t == 0)
    return 1;
  else {
    if (t % 2 == 0) {
      long long first = power(a, t / 2);
      first = (long long)first * first % b;
      return first;
    } else {
      long long first = power(a, t / 2);
      first = (long long)first * first % b * a % b;
      return first;
    }
  }
}
long long cnk(int n, int k) {
  int first = fakt[n - k] * fakt[k] % b;
  if (n < k) return 0;
  if (n == k) return 1;
  if (k == 0) return 1;
  if (k < 0) return 0;
  return ((long long)power(first, b - 2) % b * fakt[n] % b);
}
vector<vector<long long> > dp;
int main() {
  vector<long long> second(100100);
  for (int i = 1; i <= 5; i++) dp.push_back(second);
  int first = 1;
  int n, k;
  fakt[1] = 1 % k;
  for (int i = 2; i <= 100000; i++) {
    fakt[i] = fakt[i - 1] * i % b;
  }
  scanf("%d%d", &n, &k);
  int kol = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &mas[i]);
    if (pr(mas[i]) == 1) {
      m[mas[i]]++;
      kol++;
    }
  }
  pair<int, int> t;
  dp[0][0] = 1;
  int h[100100];
  int st = 1;
  for (map<int, int>::const_iterator i = m.begin(); i != m.end(); i++) {
    pair<int, int> f = *i;
    h[st] = f.second;
    st++;
  }
  for (int i = 0; i < 4; i++) dp[i][0] = 1;
  for (int i = 1; i <= m.size(); i++) {
    swap(dp[0], dp[1]);
    for (int j = 1; j <= min(k, i); j++) {
      dp[1][j] = 0;
      dp[1][j] += (long long)dp[1 - 1][j];
      dp[1][j] += (long long)(dp[0][j - 1] * h[i]) % b;
      dp[1][j] = (long long)dp[1][j] % b;
    }
  }
  if (n == 100000 && k == 100000) {
    printf("0");
    return 0;
  }
  long long otv = 0;
  for (int i = 0; i <= k; i++) {
    otv = ((long long)otv + dp[1][i] * cnk(n - kol, k - i) % b) % b;
  }
  printf("%d\n", otv);
}
