stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

#define mod 998244353

typedef long long ll;



using namespace std;



void Fastio(){

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

}



ll fact[1000006], inv[1000006];



ll fp(ll base, ll exp)

{

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



void calcFacAndInv(ll n)

{

    fact[0] = inv[0] = 1;

    for (ll i = 1; i <= n; i++)

    {

        fact[i] = (i * fact[i - 1]) ;

        inv[i] = fp(fact[i], mod - 2);

    }

}



ll ncr(ll n, ll r)

{

    return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;

}



ll npr(ll n, ll r)

{

    return (fact[n] * inv[n - r]) % mod;

}



long double  NCR(int n, int m){

    long double res = 1;

    m = min(m, n - m);

    for(int i = 0; i < m; i++){

        res = res * ( n - i) / (i + 1);

 }

    return res;

}

ll tol(string a){

    ll res=0;

    while(a[0]=='0'){

        a.erase(a.begin());

    }

    if(a=="")a="0";

    for(int i=0; i<a.size(); i++){

        res*=10; res+=a[i]-'0';

    }

    return res;

}

int check(string a, string b){

    for(int i=0; i<a.size(); i++){

        if(a[i]>b[i])return 1;

        if(b[i]>a[i])return -1;

    }

    return 0;

}

class data{

public:

    ll v,d,p;

    data(){}

    data(ll vv, ll dd, ll pp){

        v=vv;  d=dd; p=pp;

    }

};



int primeFactors(int n)

{

    ll c=0;

    while (n % 2 == 0)

    {

        c++;

        n = n/2;

    }

    for (int i = 3; i*i <= n; i = i + 2)

    {

        while (n % i == 0)

        {

            c++;

            n = n/i;

        }

    }

    if (n > 2)

        c++;

    return c;

}

int n,m, counter;

vector<int>arr[200005];

int vis[200005];

void dfs(int node){

    vis[node]=1; counter++;

    for(int i=0; i<arr[node].size(); i++){

        if(!vis[arr[node][i]])dfs(arr[node][i]);

    }

}

int main()

{

    Fastio();

    double n,k,pos=0; cin>>n>>k; k--;

    for(int i=0; i<n; i++){

        int x; cin>>x;

        if(x==1)pos=i;

    }

    ll tmp1, tmp2;

    int p=pos,kk=k;

    while(p%kk && p+1<n)p++;

    pos=p; tmp1=ceil(pos/k);

    tmp2=ceil((n-pos-1)/k);

    ll res=tmp1+tmp2;

    cout<<res<<'\n';



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 6.449529821467307x):
#include <bits/stdc++.h>

#define assem99 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define ll long long

#define ld long double

#define endll '\n'

#define sz(a) (int)(a).size()

#define RWFile freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

int dx[] = { 0, -1, 0, 1, -1, 1, -1, 1 };

int dy[] = { -1, 0, 1, 0, 1, -1, -1, 1 };

const int MOD = 1e9 + 7, N = 2e6 + 5, oo = 1e9;

const double pi = acos(-1);

using namespace std;



int main()

{

    assem99

    int n, k; cin>>n>>k;

    for(int i = 0; i < n; i++)

    {

        int a; cin>>a;

    }

    int i = k, ans = 1;

    while(i < n)

    {

        i += (k - 1);

        ans ++;

    }

    cout<<ans;



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

#define mod 998244353

typedef long long ll;



using namespace std;



void Fastio(){

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

}



ll fact[1000006], inv[1000006];



ll fp(ll base, ll exp)

{

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



void calcFacAndInv(ll n)

{

    fact[0] = inv[0] = 1;

    for (ll i = 1; i <= n; i++)

    {

        fact[i] = (i * fact[i - 1]) ;

        inv[i] = fp(fact[i], mod - 2);

    }

}



ll ncr(ll n, ll r)

{

    return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;

}



ll npr(ll n, ll r)

{

    return (fact[n] * inv[n - r]) % mod;

}



long double  NCR(int n, int m){

    long double res = 1;

    m = min(m, n - m);

    for(int i = 0; i < m; i++){

        res = res * ( n - i) / (i + 1);

 }

    return res;

}

ll tol(string a){

    ll res=0;

    while(a[0]=='0'){

        a.erase(a.begin());

    }

    if(a=="")a="0";

    for(int i=0; i<a.size(); i++){

        res*=10; res+=a[i]-'0';

    }

    return res;

}

int check(string a, string b){

    for(int i=0; i<a.size(); i++){

        if(a[i]>b[i])return 1;

        if(b[i]>a[i])return -1;

    }

    return 0;

}

class data{

public:

    ll v,d,p;

    data(){}

    data(ll vv, ll dd, ll pp){

        v=vv;  d=dd; p=pp;

    }

};



int primeFactors(int n)

{

    ll c=0;

    while (n % 2 == 0)

    {

        c++;

        n = n/2;

    }

    for (int i = 3; i*i <= n; i = i + 2)

    {

        while (n % i == 0)

        {

            c++;

            n = n/i;

        }

    }

    if (n > 2)

        c++;

    return c;

}

int n,m, counter;

vector<int>arr[200005];

int vis[200005];

void dfs(int node){

    vis[node]=1; counter++;

    for(int i=0; i<arr[node].size(); i++){

        if(!vis[arr[node][i]])dfs(arr[node][i]);

    }

}

int main()

{

    Fastio();

    double n,k,pos=0; cin>>n>>k; k--;

    for(int i=0; i<n; i++){

        int x; cin>>x;

        if(x==1)pos=i;

    }

    ll tmp1, tmp2;

    int p=pos,kk=k;

    while(p%kk && p+1<n)p++;

    pos=p; tmp1=ceil(pos/k);

    tmp2=ceil((n-pos-1)/k);

    ll res=tmp1+tmp2;

    cout<<res<<'\n';



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 6.43697625825596x):
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tt int t; cin>>t; while(t--)

#define nl cout<<"\n";

#define sp cout<<" ";

#define rep(i, a, b) for(long long i=a; i<b; i++)



const int INF = 1e9 + 7;

const int MOD = 1e9 + 7;

double PI = 4*atan(1);



int main()

{

    optimize();



    int n, k, t;

    cin>> n>> k;



    n--;

    k--;



    for(int i=0; i<n; i++)

        cin>> t;



    cout << ( n+k-1)/k;

    nl;



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k, a[100010] = {};

    cin >> n >> k;

    for (int i = 0; i < n; i++) cin >> a[i];



    cout << (n - 1 + k - 2) / (k - 1) << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4075050015334474x):
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k;

    cin >> n >> k;



    cout << (n - 1 + k - 2) / (k - 1) << endl;



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k, a[100010] = {};

    cin >> n >> k;

    for (int i = 0; i < n; i++) cin >> a[i];



    cout << (n - 1 + k - 2) / (k - 1) << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3897276759439792x):
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k;

    cin >> n >> k;



    vector<int> a(n);

    for (auto& x : a) cin >> x;



    cout << (n - 1) / (k - 1) + !!((n - 1) % (k - 1)) << endl;



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k, a[100010] = {};

    cin >> n >> k;

    for (int i = 0; i < n; i++) cin >> a[i];



    cout << (n - 1 + k - 2) / (k - 1) << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.389804851498097x):
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n, k;

    cin >> n >> k;



    vector<int> a(n);

    for (auto& x : a) cin >> x;



    cout << (n + k - 3) / (k - 1) << endl;



    return 0;

}
// Slower C++ solution:
// ABC101C - Minimization



#include <bits/stdc++.h>

using namespace std;



int main() {

	int N, K;

	cin >> N >> K;

	for (int i = 0; i < N; i++) {

		int t;

		cin >> t;

	}



	int ans;

	ans = ((N - K) + (K - 2))/ (K - 1) + 1;



	cout << ans << endl;



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2750970350485265x):
// ABC101C - Minimization



#include <cstdio>



int main() {

	int N, K;

	scanf("%d%d", &N, &K);



	printf("%d\n", (N - 2)/(K - 1) + 1);



	return 0;

}
// Slower C++ solution:
// ABC101C - Minimization



#include <bits/stdc++.h>

using namespace std;



int main() {

	int N, K;

	cin >> N >> K;

	for (int i = 0; i < N; i++) {

		int t;

		cin >> t;

	}



	int ans;

//	ans = ((N - K) + (K - 2))/ (K - 1) + 1;

	ans = (N - 2)/(K - 1) + 1;



	cout << ans << endl;



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.274631704521865x):
// ABC101C - Minimization



#include <cstdio>



int main() {

	int N, K;

	scanf("%d%d", &N, &K);



	printf("%d\n", (N - 2)/(K - 1) + 1);



	return 0;

}
// Slower C++ solution:
// ABC101C - Minimization



#include <bits/stdc++.h>

using namespace std;



int main() {

	int N, K;

	cin >> N >> K;

//	for (int i = 0; i < N; i++) {

//		int t;

//		cin >> t;

//	}



	int ans;

//	ans = ((N - K) + (K - 2))/ (K - 1) + 1;

	ans = (N - 2)/(K - 1) + 1;



	cout << ans << endl;



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.260680649895082x):
// ABC101C - Minimization



#include <cstdio>



int main() {

	int N, K;

	scanf("%d%d", &N, &K);



	printf("%d\n", (N - 2)/(K - 1) + 1);



	return 0;

}
// Slower C++ solution:
// ABC101C - Minimization



#include <bits/stdc++.h>

using namespace std;



int main() {

	int N, K;

	cin >> N >> K;

	vector<int> A(N);

	for (int i = 0; i < N; i++) {

		cin >> A.at(i);

	}



	int ans;

	ans = ((N - K) + (K - 2))/ (K - 1) + 1;



	cout << ans << endl;



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.328958872530509x):
// ABC101C - Minimization



#include <cstdio>



int main() {

	int N, K;

	scanf("%d%d", &N, &K);



	printf("%d\n", (N - 2)/(K - 1) + 1);



	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<string>

using namespace std;

int main()

{

	int k, n;

	cin >> n >> k;

	int tmp;

	for (int i = 0; i < n; i++)cin >> tmp;

	tmp = 0;

	for (int i = 0; i < n - 1; i += k - 1)

		tmp++;

	cout << tmp << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.274839756072472x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define pi 2*acos(0.0)

int main(){

      int a,b;

      cin>>a>>b;

      vector<int>vec;

      for(int i=0;i<a;i++){

        int x;

        cin>>x;

        vec.push_back(x);

      }

      sort(vec.begin(),vec.end());

        int c=0,flag=0;

      for(int i=0;i<a;i+=b-1){

            for(int j=i;j<i+b&&j<a;j++){

                if(vec[j]==vec[0])continue;

                else{

                    vec[j]=vec[0];

                    flag=1;

                }

            }

            if(flag==1){

                c++;

                flag=0;

            }



      }

      cout<<c<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.3007754438518955x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std ;



int main(){

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);



   int n, k, v ;

   cin >> n >> k ;

   for(int i = 0 ; i < n ; i++){

     cin >> v ;

   }



   int cn = 0 ;

   for(int i = 1 ; i < n ; i += k - 1){

        cn++ ;

   }



   cout << cn;



}


// Faster C++ solution for the same problem (measured speedup: 5.3341809810971625x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



const int N = 110000;



int main() {

	

	ios::sync_with_stdio(0);

	cin.tie(0), cout.tie(0);

	

	int n, K; cin >> n >> K;

	cout << (n - 2) / (K - 1) + 1 << "\n";

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.336268299470036x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define vl vector<ll>

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define mod 1000000007

#define inf 1000000000000000

#define md 998244353

#define endl "\n"



void solve()

{

    int n,k,ind;

    cin>>n>>k;

    

    int a[n];

    

    for(int i=0;i<n;i++)

    {

      cin>>a[i];

      if(a[i]==1)

      ind=i;

    } 

    

    if((n-1)%(k-1)==0)

    cout<<(n-1)/(k-1)<<endl;

    else

    cout<<(n-1)/(k-1)+1<<endl;

}



int main()

{

	

	solve();

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.272907166738712x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ull unsigned long long

#define ll long long

#define db double

#define ldb long double

#define vi vector<int>

#define vull vector<ull>

#define vll vector<ll>

#define pb push_back

#define rep(i,n) for(int i=0;i<n;i++)

#define repr(i,n) for(int i=n-1;i>=0;i--)

#define si set<int>

#define sll set<ll>

#define ins insert

#define vpp vector<pair<int,int>>

#define mp make_pair

#define ft first

#define sc second

using namespace std;



int main(){

	ios_base::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

    int n,k;

    cin>>n>>k;

    int a[n];

    int p=-1;

    rep(i,n){

    	cin>>a[i];

	}

    int r=0;

    if((n-1)%(k-1) !=0)

    r=1;

    int ans=ceil((n-1)/(k-1))+r;

    cout<<ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.33471718879232x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include <iostream>

#include <vector>

using namespace std;



int MinIndex(vector <int> A){

  int i = 0;

  int m = 1;

  for (int j = 0; j < A.size(); j++){

    if (A[j] < m)

      m = A[j];

      i = j;

  }

  return i;

}



int HowMany(vector <int> A, int K, int N){

  if (N == K)

    return 1;

  int i = 0;

  int x = N - MinIndex(A), y = MinIndex(A);

  while (x > 0){

    i++;

    x -= K;

    x++;

  }

  while (y > 0){

    i++;

    y -= K;

    y++;

  }

  return i-1;

}



int main() {

  ios_base::sync_with_stdio(false);



  int N, K;

  cin >> N >> K;

  vector <int> A(N);

  for (int i = 0; i < N; i++)

    cin >> A[i];

  cout << HowMany(A, K, N) << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.394877783532157x):
#include<stdio.h>

int main()

{

	int n,k,sum=0;

	scanf("%d%d",&n,&k);

	while(1)

	{

		n-=k;

		sum++;

		if(n<=0)break;

		n++;

	}

	printf("%d\n",sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main() {

  int N, K; cin >> N >> K;

  int A[100000]; for (int i = 0; i < N; i++) cin >> A[i];

  cout << (N + K - 3) / (K - 1) << endl;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.007882395691262x):
#include <cstdio>

using namespace std;



int main() {

  int N, K; scanf("%d %d", &N, &K);

  int A[100000]; for (int i = 0; i < N; i++) scanf("%d", &A[i]);

  printf("%d\n", (N + K - 3) / (K - 1));

  return 0;

}
// Slower C++ solution:
#include <cmath>

#include <ctime>

#include <cstdio>

#include <cctype>

#include <cstdlib>

#include <cstring>

#include <iostream>

#include <sstream>

#include <algorithm>

#include <set>

#include <stack>

#include <queue>

#include <string>

#include <vector>

#include <map>

#define maxn 110

#define maxl 1000000000

#define mod 1000000007

using namespace std;



typedef unsigned long long ull;



int a[maxn];

double ans[maxn];



bool solve(){

	int n,i,j,r,k;

	double b,v,e,f,temp2,temp;

	scanf("%d",&n);

	if(n==0)return false;

	for(i=1;i<=n;++i){

		scanf("%d",&a[i]);

		ans[i]=1e30;

	}

	scanf("%lf%d%lf%lf%lf",&b,&r,&v,&e,&f);

	ans[0]=-b;

	for(i=0;i<n;++i){

		temp=ans[i]+b;

		for(j=i+1;j<=n;++j){

			for(k=a[j-1];k<a[j];++k){

				if(k-a[i]>=r)temp2=1/(v-e*(k-a[i]-r));

				else temp2=1/(v-f*(r-(k-a[i])));

				temp+=temp2;

			}

			ans[j]=min(temp,ans[j]);

		}

	}

	printf("%.4f\n",ans[n]);

	return true;

}



int main(){

	while(solve());

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.4642658532327637x):
#include <stdio.h>

#include <string.h>

#define MAXN 10010

double v,e,f,b;

int dis[MAXN];

double dp[MAXN],time[MAXN];

int r,n;

void calc()

{

    int i;

    memset(time,0,sizeof time);

    for (i = 0; i <= dis[n]+1; i++)

    {

        double tmp;

        if (i >= r) tmp = 1.0 / (v - e * (i - r));

        else tmp = 1.0 / (v - f * (r - i));

        time[i+1] = time[i] + tmp;

    }

}



int main() {

    while (scanf("%d", &n) && n)

    {

        memset(dp,0,sizeof dp);

        memset(dis,0,sizeof dis);

        for (int i = 1; i <= n; i++)

            scanf("%d", &dis[i]);

        scanf("%lf",&b);

        scanf("%d%lf%lf%lf",&r,&v,&e,&f);

        calc();

        double min;



        for(int i = 1; i <= n; i++)

        {

            double tmp;

            min = 10000000000;

            for(int j = 0; j < i; j++)

                if ((tmp = dp[j] + time[dis[i] - dis[j]]) < min)

                    min = tmp;

            dp[i] = min + b;

        }

        printf("%.4lf\n", dp[n] - b);

    }

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>



#define	rep(i,n)	for(int i=0;i<n;i++)



using namespace std;



int main(){

	for(int n;scanf("%d",&n),n;){

		int a[101]={},r;

		rep(i,n)	scanf("%d",a+i+1);

		double b,v,e,f;	scanf("%lf%d%lf%lf%lf",&b,&r,&v,&e,&f);

		n++;



		static double t[10001];

		rep(x,a[n-1]){

			if(x<r)	t[x+1]=t[x]+1/(v-f*(r-x));

			else	t[x+1]=t[x]+1/(v-e*(x-r));

		}



		static double dp[101][10001];

		rep(i,n)rep(x,a[n-1]+1)	dp[i][x]=1e60;

		dp[0][0]=0;

		for(int i=1;i<n;i++){

			int dis=a[i]-a[i-1];

			for(int x=dis;x<=a[n-1];x++){

				dp[i][x]=min(dp[i][x],dp[i-1][x-dis]+t[x]-t[x-dis]);

				dp[i][0]=min(dp[i][0],dp[i][x]+b);

			}

		}



		printf("%.9f\n",*min_element(dp[n-1],dp[n-1]+a[n-1]+1));

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.356621431522498x):
#include<cstdio>

#include<algorithm>



#define	rep(i,n)	for(int i=0;i<n;i++)



using namespace std;



int main(){

	for(int n;scanf("%d",&n),n;){

		int a[101]={},r;

		rep(i,n)	scanf("%d",a+i+1);

		double b,v,e,f;	scanf("%lf%d%lf%lf%lf",&b,&r,&v,&e,&f);

		n++;



		static double t[10001];

		rep(x,a[n-1]){

			if(x<r)	t[x+1]=t[x]+1/(v-f*(r-x));

			else	t[x+1]=t[x]+1/(v-e*(x-r));

		}



		static double dp[101][101];

		rep(i,n)rep(j,n)	dp[i][j]=1e60;

		dp[0][0]=0;

		for(int i=1;i<n;i++){

			rep(j,i){

				int dis=a[i]-a[j];

				dp[i][j]=min(dp[i][j],dp[j][j]+t[dis]);

				dp[i][i]=min(dp[i][i],dp[i][j]+b);

			}

		}



		printf("%.9f\n",*min_element(dp[n-1],dp[n-1]+n));

	}



	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define mod 1000000007

#define maxn 100005

using namespace std;



int fac[maxn], n, m, sn, ifac[maxn], inv[maxn], f[21][maxn], ans, a[21], digit[maxn];

int C(int u, int v){

    if(u < v) return 0;

    return 1ll * fac[u] * ifac[v] % mod * ifac[u - v] % mod; 

}

int main()

{

    //freopen(".in","r",stdin);

    //freopen(".out","w",stdout);

    cin >> n; cin >> m; sn = 1 << n;

    fac[0] = 1; inv[0] = 1; ifac[0] = 1;

    for(int i = 1; i <= sn; i++) {

        fac[i] = 1ll * fac[i - 1] * i % mod;

        inv[i] = (i == 1) ? 1 : 1ll * inv[mod % i] * (mod - mod / i) % mod;

        ifac[i] = 1ll * ifac[i - 1] * inv[i] % mod; 

    }

    for(int i = 1; i <= m; i++) cin >> a[i];

    sort(a + 1, a + m + 1);

    f[m + 1][0] = 1;

    for(int i = m; i >= 1; i--)

        for(int j = 0; j < sn; j++){

            (f[i][j] += f[i + 1][j]) %= mod;

            for(int k = 0; k < n; k++){

                if(j & (1 << k)) continue;

                int p = sn - j - a[i];

                (f[i][j + (1 << k)] += 1ll * f[i + 1][j] * C(p, (1 << k) - 1) % mod * fac[1 << k] % mod) %= mod;

            }

        }

    for(int i = 0; i < sn; i++) {

        digit[i] = digit[i >> 1] + (i & 1);

        f[1][i] = 1ll * f[1][i] * fac[sn - i - 1] % mod;

        if(digit[i] % 2 == 0) ans = (ans + f[1][i]) % mod;

        else ans = (ans + mod - f[1][i]) % mod;

    }

    cout << 1ll * ans * sn % mod<< endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.889531705008047x):
#include <algorithm>

#include <cstdio>



const int N=20,M=7e4+5,mod=1e9+7;

int n,m,lim,fac[M],inv[M],a[N],f[N][M],digit[M],ans;



inline int combn(int n,int m){

	if(n<m) return 0;

	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;

}



int main(){

	scanf("%d%d",&n,&m); lim=1<<n; fac[0]=inv[0]=inv[1]=1;

	for(int i=1;i<=m;++i) scanf("%d",&a[i]);

	for(int i=1;i<=lim;++i) fac[i]=1ll*fac[i-1]*i%mod;

	for(int i=2;i<=lim;++i) inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;

	for(int i=1;i<=lim;++i) inv[i]=1ll*inv[i-1]*inv[i]%mod;

	std::sort(a+1,a+1+m); f[m+1][0]=1;

	for(int i=m;i>=1;--i){

		for(int j=0;j<lim;++j){

			f[i][j]=(f[i][j]+f[i+1][j])%mod;

			for(int k=0;k<n;++k) if(!((j>>k)&1)){

				int tmp=1ll*combn(lim-j-a[i],(1<<k)-1)*fac[1<<k]%mod;

				f[i][j+(1<<k)]=(f[i][j+(1<<k)]+1ll*tmp*f[i+1][j])%mod;

			}

		}

	}

	for(int j=0;j<lim;++j){

		digit[j]=digit[j>>1]+(j&1);

		int tmp=1ll*fac[lim-1-j]*f[1][j]%mod;

		if(digit[j]&1) ans=(ans+mod-tmp)%mod;

		else ans=(ans+tmp)%mod;

	}

	printf("%d\n",1ll*ans*lim%mod);

	return 0;

}