#define I inline #define fi first #define se second #define pb push_back #define MP make_pair #define PII pair<int , int> #define PSL pair<string , long long> #define PLL pair<long long , long long> #define all(x) (x).begin() , (x).end() #define copy(a , b) memcpy(a , b , sizeof(b)) #define clean(a , b) memset(a , b , sizeof(a)) #define rep(i , l , r) for (int i = (l); i <= (r); i ++) #define per(i , r , l) for (int i = (r); i >= (l); i --) #define PE(i , x) for(int i = head[x]; i; i = edge[i].last) #define DEBUG(x) std :: cerr << #x << '=' << x << std :: endl
typedeflonglong ll; typedefunsignedlonglong ull;
template <classT> inlinevoidread(T &x){ char c = getchar(), f = 0; x = 0; while (!isdigit(c)) f = (c == '-'), c = getchar(); while (isdigit(c)) x = x * 10 + c - '0', c = getchar(); x = f ? -x : x; }
usingnamespacestd;
constint N = 10000 + 5; constint M = 2000000 + 5; constint HA = 998244353;
int n , m , d[M];
structEdge{ int to , last; }edge[M << 1];
int edge_num; int head[M << 1];
I voidadd_edge(int from , int to){ edge[++ edge_num] = (Edge){to , head[from]}; head[from] = edge_num; edge[++ edge_num] = (Edge){from , head[to]}; head[to] = edge_num; }