Given an unweighted graph with NNN vertices and MMM edges, find the shortest distance from vertex 111 to vertex NNN.
First line: NNN MMM. Next MMM lines: edges uuu vvv.
Shortest distance, or -1 if unreachable.
2≤N≤1052 \le N \le 10^52≤N≤105, 1≤M≤2⋅1051 \le M \le 2 \cdot 10^51≤M≤2⋅105
4 4 1 2 2 3 3 4 1 4
1