#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,K; cin >> N >> K; vector P(N); iota(P.begin(),P.end(),0); while(K--){ int x,y; cin >> x >> y; x--; y--; swap(P.at(x),P.at(y)); } vector Len(N+1); long long answer = 1; vector already(N); for(int i=0; i