Build a graph
Tag(s):

## Algorithms, Graphs

Problem
Editorial
Analytics

You are given an integer $n$. Determine if there is an unconnected graph with $n$ vertices that contains at least two connected components and contains the number of edges that is equal to the number of vertices. Each vertex must follow one of these conditions:

1. Its degree is less than or equal to 1.
2. It's a cut-vertex.

Note

• The graph must be simple.
• Loops and multiple edges are not allowed.

Input format

• First line: $n$

Output format

Print Yes if it is an unconnected graph. Otherwise, print No.

Constraints

$1\le n\le100$

SAMPLE INPUT
3

SAMPLE OUTPUT
No

Explanation

There is only one graph with the number of edges equal to the number of vertices (triangle) which is connected.

Time Limit: 0.5 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, C++17, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, Java 14, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, Python 3.8, R(RScript), Racket, Ruby, Rust, Scala, Swift-4.1, Swift, TypeScript, Visual Basic

## CODE EDITOR

Initializing Code Editor...

## This Problem was Asked in Challenge Name

November Circuits '19

OTHER PROBLEMS OF THIS CHALLENGE
• Basic Programming > Input/Output
• Algorithms > Graphs
• Data Structures > Arrays
• Math > Basic Math
• Algorithms > Dynamic Programming