##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You are given a simple undirected graph with vertices numbered from to . The number is even.
Initially, no vertex is deleted. In one operation, you may choose an edge such that both and are not deleted yet, and every vertex with has already been deleted. Then vertices and are deleted.
A deletion sequence is valid if it contains exactly operations and all vertices are deleted at the end.
Find the number of valid deletion sequences modulo .
There is only one edge, so the only possible sequence deletes vertices and .
First vertices and must be deleted, then vertices and can be deleted.
There are two sequences using edges and . There is also one sequence using first and second.
Every valid sequence repeatedly deletes two currently adjacent remaining vertices. For this graph, there are such sequences.