#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32000000")
using namespace std;
int n, k;
int a[100005];
bool is_lucky(int x) {
  while (x) {
    int d = x % 10;
    if (d != 4 && d != 7) return false;
    x /= 10;
  }
  return true;
}
int q[2000];
int t;
int dp[2000][2000];
int c[100005];
int pow(int a, int b) {
  long long res = 1;
  while (b) {
    if (b % 2) res = (res * a) % 1000000007;
    a = ((long long)a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
int inv(int x) { return pow(x, 1000000007 - 2); }
void do_solve() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  map<int, int> m;
  int b = 0;
  for (int i = 0; i < n; i++)
    if (is_lucky(a[i]))
      m[a[i]]++;
    else
      b++;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++)
    q[t++] = it->second;
  for (int i = 0; i <= t; i++) dp[i][0] = 1;
  for (int i = 1; i <= t; i++)
    for (int j = 1; j <= i; j++) {
      dp[i][j] =
          ((long long)dp[i - 1][j - 1] * q[i - 1] + dp[i - 1][j]) % 1000000007;
    }
  c[0] = 1;
  for (int i = 0; i < b; i++) {
    c[i + 1] = ((long long)c[i] * (b - i)) % 1000000007;
    c[i + 1] = ((long long)c[i + 1] * inv(i + 1)) % 1000000007;
  }
  int res = 0;
  for (int i = 0; i <= k && i <= t; i++) {
    if (k - i <= b) res = ((long long)dp[t][i] * c[k - i] + res) % 1000000007;
  }
  cout << res;
}
int main() {
  do_solve();
  return 0;
}
