#include using namespace std; using ll = long long; #include using mint = atcoder::modint; int main(){ int n,b; cin>>n>>b; mint::set_mod(b); int cnt = 0; vector now(n,0); vector a(n); for(int i = 0;i>a[i]; bool ok = true; for(int i = 0;i1) ok = false; if(i==0){ mint ans = mint(2).pow(n-1); cout<