A. Dasha and Stairs
time limit per test:2 seconds
memory limit per test:256 megabytes
input:standard input
output:standard output

On her way to programming school tiger Dasha faced her first test — a huge staircase!

The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is possible that it has something to do with their color. So on some interval of her way she calculated two values — the number of steps with even and odd numbers.

You need to check whether there is an interval of steps from the l-th to the r-th (1 ≤ l ≤ r), for which values that Dasha has found are correct.

Input

In the only line you are given two integers ab (0 ≤ a, b ≤ 100) — the number of even and odd steps, accordingly.

Output

In the only line print "YES", if the interval of steps described above exists, and "NO" otherwise.

Examples
input
2 3
output
YES
input
3 1
output
NO
Note

In the first example one of suitable intervals is from 1 to 5. The interval contains two even steps — 2 and 4, and three odd: 1, 3 and 5.

 

题意:已知有a个偶数b个奇数,判断这些数能不能组成连续正整数数列。

//没有考虑a==b和a=0并且b=0的时候
#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int a,b;
int main()
{
scanf("%d%d",&a,&b);
if (abs(a-b)== || a==b && a!= && b!=) printf("YES\n");
else printf("NO\n");
return ;
}

Codeforces Round #394 (Div. 2) A. Dasha and Stairs的更多相关文章

  1. Codeforces Round #394 (Div. 2) A. Dasha and Stairs 水题

    A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to prog ...

  2. Codeforces Round #394 (Div. 2) E. Dasha and Puzzle(分形)

    E. Dasha and Puzzle time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. Codeforces Round #394 (Div. 2) E. Dasha and Puzzle 构造

    E. Dasha and Puzzle 题目连接: http://codeforces.com/contest/761/problem/E Description Dasha decided to h ...

  4. Codeforces Round #394 (Div. 2) D. Dasha and Very Difficult Problem 贪心

    D. Dasha and Very Difficult Problem 题目连接: http://codeforces.com/contest/761/problem/D Description Da ...

  5. Codeforces Round #394 (Div. 2) C. Dasha and Password 暴力

    C. Dasha and Password 题目连接: http://codeforces.com/contest/761/problem/C Description After overcoming ...

  6. Codeforces Round #394 (Div. 2) B. Dasha and friends 暴力

    B. Dasha and friends 题目连接: http://codeforces.com/contest/761/problem/B Description Running with barr ...

  7. Codeforces Round #394 (Div. 2) D. Dasha and Very Difficult Problem —— 贪心

    题目链接:http://codeforces.com/contest/761/problem/D D. Dasha and Very Difficult Problem time limit per ...

  8. Codeforces Round #394 (Div. 2) C. Dasha and Password —— 枚举

    题目链接:http://codeforces.com/problemset/problem/761/C C. Dasha and Password time limit per test 2 seco ...

  9. Codeforces Round #394 (Div. 2) B. Dasha and friends —— 暴力 or 最小表示法

    题目链接:http://codeforces.com/contest/761/problem/B B. Dasha and friends time limit per test 2 seconds ...

随机推荐

  1. HDU3552(贪心)

    题目是将一系列点对(a,b)分成两个集合.使得A集合的最大a+B集合的最大数b得和最小. 思路:http://blog.csdn.net/dgq8211/article/details/7748078 ...

  2. 0502-Hystrix保护应用-简介,使用,健康指标等

    一.概述 参看地址:https://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_circuit_ ...

  3. IOS JAVA PHP 安卓 通用加密方式

    PHP代码: class Aes { private $hex_iv = '00000000000000000000000000000000'; // converted JAVA byte code ...

  4. Log4Net各参数API

    <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSe ...

  5. OPNET 安装运行问题总结

    OPNET作为专业级网络仿真软件,其强大的功能使其在多个领域有广泛的应用.“越强大的软件,安装越闹心”,OPNET就是这样一款安装和运行的都很闹心的软件,这里简单转载和记录我安装OPNET和使用中的问 ...

  6. nohup- Shell后台运行

    &方式: Unix/Linux下一般想让某个程序在后台运行,很多都是使用 & 在程序结尾来让程序自动运行.比如我们要运行mysql在后台:          /usr/local/my ...

  7. application/x-www-form-urlencoded和multipart/form-data

     我们在提交表单的时候,form表单参数中会有一个enctype的参数. EncType表明提交数据的格式,用 Enctype 属性指定将数据发到服务器时浏览器使用的编码类型. enctype指定了H ...

  8. SQL生成一串随机数

    SELECT RIGHT (CONVERT(VARCHAR(20),CONVERT(DECIMAL(20,15),rand())),15) AS c_random_number

  9. 【leetcode刷题笔记】Majority Element

    Given an array of size n, find the majority element. The majority element is the element that appear ...

  10. 浅析 MySQL Replication(本文转自网络)

    作者:卢飞 来源:DoDBA(mysqlcode) 0.导读 本文几乎涵盖了MySQL Replication(主从复制)的大部分知识点,包括Replication原理.binlog format.复 ...