#include int n,m,v,x,i; int main(){ auto&q=std::cin>>n>>m; while(i++>v,x^=v; std::cout<<(x?0:atcoder::modint998244353(2).pow(20ll*(n-1)*(m-1)).val()); }