you organizer famous Zurich Music Festival there n singer perform festival identify integer 1 2 dot n you choose order go perform stage you m friend set favourite singer more precisely 1le ile m ith friend like singer s_i1 s_i 2 dot s_i q_iA friend happy singer like perform consecutively arbitrary order an ordering singer valid make friend happyCompute number valid ordering modulo 998244353