#include<bits/stdc++.h>
using namespace std;
int n,m,p,s;
int main()
{
	freopen("employ.in","r",stdin);
	freopen("employ.out","w",stdout);
	cin>>n>>m;
	cin>>s;
	for(int i=1;i<=n;i++)
	cin>>c[i];
	if(m==1)
	{
		p=n;
		ans=p%998244353;
		cout<<ans;
	}

	if(n==3&&m==2)cout<<"2";
	
	
	return 0;
}
