ll@n,@b,a[n]; modint().setmod(b); sets; rep(r,n){ wt(modint(2)**(s.count(a[r])?n:n-1-s.size())); s.insert(a[r]); }