#include<iostream>
#include<map>
#define maxn 100001
using namespace std;
typedef long long ll;
int P=1000000007;
int d=0,ans=0,tot=0,fact[maxn],nn,k,c[maxn],dp[2001][2001];
map<int,int>mp;
int fast(int a,int b)
{
int rest=1;
while(b)
{
if(b%2==1)
rest=1ll*rest*a%P;
a=1ll*a*a%P;
b/=2;
}
return rest;
}
bool check(int x)
{
if(x==0)
return false;
while(x)
{
int t=x%10;
if(t!=4&&t!=7)
return false;
x=x/10;
}
return true;
}
int cale(int n,int m)
{
if(n>m)
return 0;
return 1ll*fact[m]%P*fast(fact[n],P-2)%P*fast(fact[m-n],P-2)%P;
}
int main()
{
//freopen("lucky.in.txt","r",stdin);
//freopen("lucky.out.txt","w",stdout);
int x;
cin>>nn>>k;
for(int i=1;i<=nn;i++)
{
cin>>x;
if(check(x))
mp[x]++;
else d++;
}
fact[0]=1;
for(int i=1;i<=nn;i++)
fact[i]=1LL*fact[i-1]*i%P;
for(int i=0;i<=tot;i++)
dp[i][0]=1;
for(map<int,int>::iterator it=mp.begin();it!=mp.end();it++)
c[++tot]=it->second;
for(int i=1;i<=tot;i++)
for(int j=1;j<=i;j++)
{
dp[i][j]=(dp[i][j]+dp[i-1][j])%P;
dp[i][j]=(dp[i][j]+1ll*dp[i-1][j-1]*c[i])%P;
}
for(int i=0;i<=min(tot,k);i++)
ans=(ans+1ll*dp[tot][i]*cale(k-i,d))%P;
cout<<ans<<endl;
return 0;
}