CSES - Aalto Competitive Programming 2024 - wk6 - Wed - Microservice hell
  • Time limit: 1.00 s
  • Memory limit: 512 MB

The company Maija is working at has created itself a hellish microservice architecture. Blissfully unaware of the situation, the middle management wishes to introduce recursive microservices - microservices that have the capability call themselves but with different parameters! However, they have realized the inherent danger in this design and have tasked Maija to prevent any sort of cyclical service calling loops from forming.

The sighs of the system architect have gradually been getting longer and more turbulent. Maija figures the guy is going to burn out any moment now, so she decides to walk the extra mile to help him and restricts the new feature even more.

The recursive micro-service takes a single positive integer as input, which is less than or equal to nn. There are mm relations in the system: input aia_i calls input bib_i. Maija decides that no service should cause more than XX service calls. Help Maija determine whether the recursive microservice satisfies this constraint.

Input

The first line contains three integers n,m,n,m, and XX. The ii-th of next mm following line contains two integers aia_i and bib_i.

Output

Print "Yes" if the microservice satisfies the condition and "No" otherwise.

Constraints

  • 2n1052 \leq n \leq 10^5
  • 1m2×1051 \leq m \leq 2 \times 10^5
  • 1X10121 \leq X \leq 10^{12}
  • 1ai,bin1 \leq a_i, b_i \leq n
  • aibia_i \neq b_i
  • (ai,bi)(aj,bj)(a_i, b_i) \neq (a_j, b_j) if iji \neq j

Example 1

Input:

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

Output:

Yes

Example 2

Input:

5 7 1000000000000
2 4
3 2
3 5
3 1
5 3
5 4
1 2

Output:

No

Example 3

Input:

4 6 7
1 2
1 3
1 4
2 3
2 4
3 4

Output:

No