There are a total of A + B cats and dogs.
Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.
Determine if it is possible that there are exactly X cats among these A + B animals.

-----Constraints-----
 - 1 \leq A \leq 100
 - 1 \leq B \leq 100
 - 1 \leq X \leq 200
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
A B X

-----Output-----
If it is possible that there are exactly X cats, print YES; if it is impossible, print NO.

-----Sample Input-----
3 5 4

-----Sample Output-----
YES

If there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.

Difficulty: introductory

Starter code:

Solutions:
a, b, x = map(int, input().split())
print("YES" if a <= x and x <= a+b else "NO")

a,b,x=map(int, input().split())
print("YES" if a+b>=x>=a  else "NO")

a,b,x = list(map(int,input().split()))
if a<=x and a+b>=x:
  print("YES")
else:
  print("NO")


a, b, x= list(map(int, input().split()))

if a <= x <= a + b:
    print("YES")
else:
    print("NO")


a, b, x = map(int, input().split())
if a > x:
    print('NO')
elif x - a <= b:
    print('YES')
else:
    print('NO')

A, B, X = list(map(int, input().split()))
if A <= X <= A+B:
    print('YES')
else:
    print('NO')


a,b,x=map(int,input().split())
if a<=x<=a+b:
  print("YES")
else:
  print("NO")

a,b,c=map(int,input().split())
if c<a:
  print("NO")
else:
  if c>a+b:
    print("NO")
  else:
    print("YES")

A,B,X = map(int, input().split())
print('YES' if A <= X and A+B >= X else 'NO')

a,b,x = map(int,input().split())
print('YES') if a <= x and x <= a+b else print('NO')

a,b,x=map(int,input().split())
if a<=x<=a+b:print('YES')
else:print('NO')

A,B,X = map(int,input().split())
print('YES' if A <= X <= A+B else 'NO')

a,b,x=map(int,input().split())
if a<=x and a+b>=x:
  print("YES")
else:
  print("NO")

A,B,X=map(int,input().split())
if A+B>=X and A<=X:
  print("YES")
else:
  print("NO")

a, b, x = map(int, input().split())
if a <= x <= a + b:
    print('YES')
else:
    print('NO')

def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, x = Input()
    print("YES"
          if a <= x <= (a + b)
          else "NO")


main()

a, b, x = map(int, input().split())
print("YES" if a <= x and a + b >= x else "NO")

a, b, x = list(map(int, input().split()))
if a <= x <= a+b:
    print("YES")
else:
    print("NO")


a, b, c = map(int, input().split())
if c >= a and c <= a + b:
  print('YES')
else:
  print('NO')

A,B,X = map(int,input().split())
s = "YES"
if A > X or A+B < X:
  s = "NO"
print(s)

a,b,x=map(int,input().split())
print("NO")if a+b<x or x<a else print("YES")

a, b, x = map(int, input().split())
if a+b < x or a > x:
  print("NO")
else:
  print("YES")

a,b,x = map(int,input().split())
if a > x:
  print("NO")
elif a + b < x:
  print("NO")
else:
  print("YES")

a,b,x=map(int,input().split())
ans="YES" if x<=a+b and x>=a else "NO"
print(ans)

a, b, c = map(int, input().split())
if a <= c and c <= a+b:
  print("YES")
else:
  print("NO")

A,B,X = map(int,input().split())
print("YES" if A <= X <= A+B else "NO")

a,b,x=map(int,input().split())
if a<=x<=a+b:
  print("YES")
else:
  print("NO")

a,b,x=map(int,input().split())
if a==x:print("YES")
elif a<x and a+b>=x:print("YES")
else:print("NO")

a=input().split(' ')
A=int(a[0])
B=int(a[1])
X=int(a[2])
if A<=X and A+B>=X:
  print('YES')
else:
  print('NO')

a,b,x = map(int,input().split())
if x - a < 0:
    print("NO")
else:
    print(("NO","YES")[x-a<=b])

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if a+b>=c:
  if a<=c:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

a, b, x = map(int, input().split())
if a <= x <= a + b:
    print('YES')
else:
    print('NO')

def resolve():
    a, b, x = map(int, input().split())
    ans = ""
    if a <= x and x <= a+b:
        ans = "YES"
    else:
        ans = "NO"
    print(ans)
resolve()

A, B, X = [int(i) for i in input().split()]

if A <= X <= A + B:
  print('YES')
else:
  print('NO')


a,b,x = map(int, input().split())
if a<=x<=a+b:
    print("YES")
else:
    print("NO")

a,b,x=map(int,input().split())
if a>x or x>a+b:
    print("NO")
else:
    print("YES")

#!/usr/bin/env python3

a, b, x = list(map(int, input().split()))

if a+b >= x and x >= a:
    print("YES")
else:
    print("NO")


a,b,x = map(int,input().split())

if a>x:
    print('NO')
else:
    if x-a <= b:
        print('YES')
    else:
        print('NO')

# coding: utf-8
import math

cat, meta, x = map(int, input().split())

if cat > x or cat + meta < x:
    print("NO")
else:
    print("YES")

a,b,x=map(int,input().split())
if a<=x<=a+b:
    print("YES")
else:
    print("NO")

a, b, x = map(int, input().split())

if a <= x:
    print("YES" if a + b >= x else "NO")
else:
    print("NO")

a,b,c=map(int,input().split(" "))
print("YES") if a<=c and a+b>=c else print("NO")

a,b,x = map(int,input().split())
print("YES" if a<=x and a+b-x>0 else "NO")

a, b, x = map(int,input().split())
if a<=x and a+b>=x:
    print("YES")
else:
    print("NO")

a,b,x=map(int,input().split())
if x>a+b or x<a:
  print("NO")
else:
  print("YES")

a,b,x=map(int, input().split())
print('NO' if x<a or x>a+b else 'YES')

a,b,x=map(int,input().split())
if a<=x and x<=a+b:
    print("YES")
else:
    print("NO")

a, b, x = map(int, input().split())
if a<=x<=a+b:
    print('YES')
else:
    print('NO')

A,B,X=map(int,input().split())
ans="NO"
if A<=X<=A+B:
    ans="YES"
print(ans)

a,b,x=map(int,input().split())
if a<=x<=a+b:print("YES")
else:print("NO")

a,b,x=list(map(int,input().split()))
if a>x:
  print('NO')
elif a+b>=x:
  print('YES')
else:
  print('NO')


a,b,x = map(int,input().split())

if a <= x and a + b >= x:
  print('YES')
else:
  print('NO')

a,b,c = map(int,input().split())
if a <= c and a+b >= c:
        print('YES')
else:
    print('NO')

a, b, x = map(int, input().split())
if a > x:
  print('NO')
elif a+b >= x:
  print('YES')
else:
  print('NO')

a,b,x = list(map(int, input().split()))


print(('YES' if x <= a+b and a <= x else 'NO'))


a, b, x =map(int,input().split())


if a <= x and (a+b) >= x:
    print("YES")
else:
    print("NO")

a,b,x = map(int, input().split())
if a <= x <= a+b:
    print('YES')
else:
    print('NO')

a,b,x=list(map(int, input().split()))

if (a+b)>=x>=a:
    print("YES")
else:
    print("NO")


a,b,c=list(map(int,input().split()))
if a<=c:
  if a+b>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')


a, b, x = list(map(int, input().split()))
if (x >= a) and (x <= a + b):
    print('YES')
else:
    print('NO')


A, B, X = map(int, input().split())
if X >= A and X <= A+B:
    print("YES")
else:
    print("NO")

a, b, x = list(map(int, input().split()))


if 0 <= x - a <= b:
    print("YES")
else:
    print("NO")

A, B, X = map(int, input().split())

if X >= A and A + B >= X:
  print('YES')
else:
  print('NO')

A, B, X = list(map(int, input().split()))
if A + B < X or A > X:
    print('NO')
else:
    print('YES')


A,B,X=map(int,input().split())
if A+B>=X:
    if X<A :
        print('NO')
    else :
        print('YES')
else :
    print('NO')

a,b,n=map(int,input().split())
if a<=n and n<=a+b:
  print("YES")
else:
  print("NO")

A,B,X = map(int,input().split())
print("YES" if A <= X and A + B >= X else "NO")

a, b, x = map(int, input().split())
print("YES" if a <= x <= a + b else "NO")

a,b,x = map(int,input().split())
if a > x:
    print('NO')
elif x - a < b:
    print('YES')
else:
    print('NO')

lst = input().split()
a = int(lst[0])
b = int(lst[1])
x = int(lst[2])

if (x <= a + b) and (a <= x):
   print('YES')
else:
   print('NO')

a,b,x=map(int,input().split())
if(a>x):
    print("NO")
elif(a+b<x):
    print("NO")
else:
    print("YES")

a,b,x=map(int,input().split())
print("YES" if a<=x<=a+b else "NO")

a,b,c = [int(x) for x in input().split()]
res = "YES"
if a > c:
  res = "NO"
if a + b < c:
  res = "NO"
print(res)

a,b,x = map(int,input().split())
if a <= x and a+b >= x:
  print("YES")
else:
  print("NO")

a,b,x = map(int,input().split())
if x>=a and x<=a+b:
    print("YES")
else:
    print("NO")

a,b,x = map(int,input().split())
print("YES" if a+b >= x and a <= x else "NO")

def main():
    a, b, x = list(map(int, input().split()))
    print(('YES' if a <= x and a + b >= x else 'NO'))


def __starting_point():
    main()

__starting_point()

A, B, X = map(int, input().split())

if 0 <= X - A <= B:
    print('YES')
else:
    print('NO')

a,b,x=map(int,input().split())
if a<=x<=a+b:
    print("YES")
else:
    print("NO")

a, b, x = map(int, input().split())
if a == x or (a + b >= x and a < x):
  print("YES")
else:
  print("NO")

a,b,x=map(int,input().split())

if a<=x and a+b>=x:
    ans="YES"
else:
    ans="NO"
print(ans)

a,b,x = map(int,input().split())
if a <= x and a+b >= x:
  print("YES")
else:
  print("NO")

a, b, x = map(int, input().split())

if a <= x <= a + b:
    print('YES')
else:
    print('NO')

A,B,X=map(int,input().split())
if X < A or A+B < X:
    print('NO')
else:
    print('YES')

a, b, x = list(map(int, input().split()))
if a + b >= x and a <= x:
  print("YES")
else:
  print("NO")


A,B,X=list(map(int,input().split()))
if A<=X and X<=A+B:
    print("YES")
else:
    print("NO")


a,b,x=map(int,input().split())
if a+b >= x and a <= x:
    print('YES')
else:
    print('NO')

A,B,X = list(map(int,input().split()))
if A>X:
    print("NO")
if A<=X:
    if (A +B)<X:
        print("NO")
    else:
        print("YES")


a,b,x=list(map(int,input().split()))
c=a+b


if x<=c:
    if a>x:
        print('NO')
    else:
        print('YES')
else:
    print('NO')


A, B, X = map(int, input().split())
for i in range(0, B + 1):
    if A + i == X:
        print("YES")
        return
print("NO")

a,b,x = map(int,input().split())
if a <= x <= a+b:
    print("YES")
else:
    print("NO")

#ABC094A
a,b,x = map(int,input().split())
print("YES" if a<=x <= a+b else "NO")

a,b,x = list(map(int, input().split()))

if a + b < x :
    print("NO")

elif a > x :
    print("NO")

else :
    print("YES")
    


a, b, x = map(int, input().split())
if a <= x <= a + b:
    print("YES")
else:
    print("NO")

a,b,x = map(int,input().split())
if a<=x and x<=a+b:
    print("YES")
else:
    print("NO")

a, b, x = map(int, input().split())
print('YES' if a <= x <= a + b else 'NO')

cat_num, unknown_animals, question_num_cat = map(int, input().split())

if cat_num <= question_num_cat <= cat_num + unknown_animals:
    print('YES')
else:
    print('NO')

a, b, x = map(int, input().split())

if a+b>=x and a<=x:
  print('YES')
else:
  print('NO')

a,b,x = map(int,input().split())

if a+b >= x and a <= x:
  print("YES")
else:
  print("NO")

A,B,X = map(int, input().split())
if X >= A and B >= (X-A):
  print('YES')
else:
  print('NO')