Competitive Programming Solutions

GitHub
back to dashboard

E. Interval Sweep

Codeforces - Contest #1 · limit: 1s · memory: 256MB · view on codeforces

input

0 0

output

YES
Main.java
static void solve() {

        // Write your solution here
        int a = in.nextInt();
        int b = in.nextInt();
        out.println((Math.abs(a - b) <= 1 && a != 0 && b != 0)? "YES" : "NO");
    }