#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,B; cin >> N >> B; vector power2(N+1,1),A(N); for(auto &a : A) cin >> a,a--; power2.at(0) %= B; for(int i=1; i<=N; i++) power2.at(i) = power2.at(i-1)*2%B; vector appear(N); long long all = power2.at(N); for(int i=0; i