You are given a simple connected undirected graph with vertices and edges. Initially, vertex contains balls.
In one operation, choose two adjacent vertices and keep one ball at one of them. Swap all the remaining balls between the two vertices.
Formally, choose an ordered pair of adjacent vertices such that vertex currently contains at least one ball. If their current numbers of balls are and , respectively, replace them simultaneously by and . All other vertices remain unchanged.
Determine whether, after zero or more operations, every vertex can contain exactly balls.
The answer is case-insensitive. Any capitalization of the letters is accepted, including , , and .