Beaverland consists of N cities, numbered from 1 to N. There are M roads connecting cities, numbered from 1 to M. The road i (1≤i≤M) connects the city A_i and the city B_i bidirectionally, and the length of the road i is C_i. It is possible to move from any city to any other city by passing through a number of roads.
Bitaro is a beaver living in the city 1. He goes to a school in the city N. He usually takes the same route to the school. His route to the school satisfies the following conditions.
Since today is a fine day, Bitaro decided to go back to his home by taking a roundabout way. Namely, he will take a route longer than L from the city N to the city 1. Since Bitaro is easily bored, he does not want to visit the same city more than once. Therefore, when he takes a roundabout way to his home, it is not allowed to visit the same city more than once, and it is not allowed to turn back on the way.
Given information of the cities and the roads in Beaverland, write a program which determines whether there exists a roundabout way from the school to Bitaro’s home.
Read the following data from the standard input. Given values are all integers.
N M
A_1 B_1 C_1
A_2 B_2 C_2
⋮
A_M B_M C_M
Write one line to the standard output. Output 1 if there exists a route to Bitaro’s home longer than L without visiting the same city more than once. Otherwise, output 0.