QOJ.ac

QOJ

時間限制: 2.5 s 記憶體限制: 512 MB 總分: 100

#8461. Poem Composition by Sight

统计

Given a simple undirected graph, determine whether there exist two simple cycles of the same length.

Input

The first line contains two positive integers $n$ and $m$, representing the number of vertices and the number of edges, respectively.

The next $m$ lines each contain two positive integers describing an edge.

Output

If such cycles exist, output Yes; otherwise, output No.

Examples

Input 1

10000 0

Output 1

No

Input 2

5 6
1 2
2 3
3 1
1 4
4 5
5 1

Output 2

Yes

Subtasks

For all test cases, $1\le n \le 10^4$ and $1\le m \le 10^6$.

Subtask ID $n\leq$ Score
$1$ $10$ $40$
$2$ $20$ $20$
$3$ $400$ $20$
$4$ $10000$ $20$

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1544EditorialOpenNew Editorial for Problem #8461xcx09022026-04-16 09:42:59View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.