#Lutece1710. 两眼一闭大力搜(吃惊高清重置版)
两眼一闭大力搜(吃惊高清重置版)
Migrated from Lutece 1710 两眼一闭大力搜(吃惊高清重置版)
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给一个无向图,有个点,条边
现给出起点和终点,问是否存在一条从起点到终点的合法路径.
一条合法路径必须满足下列条件:
- 所经过的点不能重复
- 路径长度必须为
Input
输入第一行有三个数,,.
接下来行,每行两个整数,表示和之间有一条无向边连接
接下来一行两个整数,表示起点和终点
数据保证:
Output
输出一行表示答案,如果存在则输出,否则输出
Samples
6 5 5
1 2
2 3
3 4
4 5
5 6
1 6
YES
6 5 4
1 2
2 3
3 4
4 5
5 6
1 6
NO
Note
大力搜索一发吗少年
Resources
xiper