Ted has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks for the first time. Then every s seconds after it, it barks twice with 1 second interval. Thus it barks at times t, t + s, t + s + 1, t + 2s, t + 2s + 1, etc.

 [Image] 

Barney woke up in the morning and wants to eat the pineapple, but he can't eat it when it's barking. Barney plans to eat it at time x (in seconds), so he asked you to tell him if it's gonna bark at that time.


-----Input-----

The first and only line of input contains three integers t, s and x (0 ≤ t, x ≤ 10^9, 2 ≤ s ≤ 10^9) — the time the pineapple barks for the first time, the pineapple barking interval, and the time Barney wants to eat the pineapple respectively.


-----Output-----

Print a single "YES" (without quotes) if the pineapple will bark at time x or a single "NO" (without quotes) otherwise in the only line of output.


-----Examples-----
Input
3 10 4

Output
NO

Input
3 10 3

Output
YES

Input
3 8 51

Output
YES

Input
3 8 52

Output
YES



-----Note-----

In the first and the second sample cases pineapple will bark at moments 3, 13, 14, ..., so it won't bark at the moment 4 and will bark at the moment 3.

In the third and fourth sample cases pineapple will bark at moments 3, 11, 12, 19, 20, 27, 28, 35, 36, 43, 44, 51, 52, 59, ..., so it will bark at both moments 51 and 52.

Difficulty: EASY
Tags: Mathematics

Implementation

Starter code:

Solutions:
import math
(t, s, x) = map(int, input().split())
a = (x - t) / s
b = (x - t - 1) / s
if t == x:
	print('YES')
elif x < t:
	print('NO')
elif a - math.ceil(a) == 0 and a > 0:
	print('YES')
elif b - math.ceil(b) == 0 and b > 0:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x < t:
	print('NO')
elif (x - t) // s and (x - t) % s in [0, 1] or x == t:
	print('YES')
else:
	print('NO')


(t, s, x) = [int(i) for i in input().split()]
if x < t:
	print('NO')
	exit()
if (x - t) % s == 0 or ((x - t) % s == 1 and x - t > 1):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split(' '))
n = x - t
if n > 1:
	if n % s == 0 or n % s == 1:
		print('YES')
	else:
		print('NO')
elif n == s or n == 0:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x == t or (x >= t + s and (x - t) % s <= 1):
	print('YES')
else:
	print('NO')


from sys import stdin
(t, s, x) = map(int, stdin.readline().split())
res = t + s + 1
if t == x or t + s == x or t + s + 1 == x:
	print('YES')
elif t == 0 and s == 0 and (x == 2):
	print('NO')
elif x < t + s + 1:
	print('NO')
elif (x - (t + s + 1)) % s == 0:
	print('YES')
else:
	a = (x - (t + s + 1)) % s
	if s - a == 1:
		print('YES')
	else:
		print('NO')


(t, s, x) = map(int, input().split(' '))
x = x - t
if x < s:
	if x == 0:
		print('YES')
	else:
		print('NO')
else:
	x = x % s
	if x > 1:
		print('NO')
	else:
		print('YES')


(start, interval, x) = map(int, input().split())
if x == start or (x >= start + interval and ((x - start) % interval == 0 or (x - start - 1) % interval == 0)):
	print('YES')
else:
	print('NO')


def main():
	(t, s, x) = list(map(int, input().strip().split()))
	if x < t:
		print('NO')
	elif x == t + 1 and s != 1:
		print('NO')
	elif (x - t) % s == 0 or (x - t - 1) % s == 0:
		print('YES')
	else:
		print('NO')

def __starting_point():
	main()
__starting_point()


(t, s, x) = map(int, input().split())
k1 = (x - t) // s
k2 = (x - t - 1) // s
if k1 >= 0 and t + k1 * s == x or (k2 > 0 and t + k2 * s + 1 == x):
	print('YES')
else:
	print('NO')


(t, s, p) = input().split()
t = int(t)
p = int(p)
s = int(s)
if t > p:
	print('NO')
	exit()
w = p - t
if w == 0:
	print('YES')
elif w % s == 0:
	print('YES')
elif w % s != 0:
	if w < s:
		print('NO')
	else:
		t = w // s
		if s * t + 1 == w:
			print('YES')
		else:
			print('NO')
else:
	print('NO')


(t, s, x) = [int(i) for i in input().split()]
if x % s == t % s and t <= x:
	print('YES')
elif x % s == (t + 1) % s and t + 1 < x:
	print('YES')
else:
	print('NO')


(t, s, x) = input().split()
(t, s, x) = (int(t), int(s), int(x))
i = (x - t) / s

def belongs(i):
	if float(int(i)) == i and i >= 1:
		return True
	return False
if x == t:
	print('YES')
elif belongs(i):
	print('YES')
else:
	i = (x - t - 1) / s
	if belongs(i):
		print('YES')
	else:
		print('NO')


(t, s, x) = (int(i) for i in input().split())
ans = 'NO'
if x < t:
	ans = 'NO'
elif x == t + 1:
	ans = 'NO'
elif (x - t) % s == 0 or (x - t) % s == 1:
	ans = 'YES'
else:
	ans = 'NO'
print(ans)


import sys
(T, S, X) = map(int, sys.stdin.readline().split())
r1 = (X - T) % S
r2 = (X - T - 1) % S
if X - T == 1 or X < T:
	print('NO')
elif r1 == 0 or r2 == 0:
	print('YES')
else:
	print('NO')


for _ in range(1):
	(t, s, x) = map(int, input().split())
	if x == t:
		print('YES')
	elif x < t + s:
		print('NO')
	else:
		r = (x - t) % s
		if r == 0 or r == 1:
			print('YES')
		else:
			print('NO')


a = input().split(' ')
t = int(a[0])
s = int(a[1])
x = int(a[2])
if x == t + 1 or x < t:
	print('NO')
elif x == t:
	print('YES')
elif x == t + s:
	print('YES')
elif (x - t) % s == 0:
	print('YES')
elif (x - t - 1) % s == 0:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
print('NYOE S'[x >= t and x != t + 1 and (x % s in [t % s, (t + 1) % s])::2])


input_string = input()

def calculate(t, s, x):
	if pineapple_is_barks(t, s, x) == True:
		print('YES')
	else:
		print('NO')

def pineapple_is_barks(t, s, x):
	i = int((x - t) // s * 2)
	if i < 1:
		return t == x
	if calculate_time_of_iteration(t, s, i) == x:
		return True
	elif calculate_time_of_iteration(t, s, i) + 1 == x:
		return True
	return False

def calculate_time_of_iteration(t, s, i):
	if i == 1:
		return t
	return t + s * (i // 2) + i % 2
(t, s, x) = input_string.split(' ')
t = int(t)
s = int(s)
x = int(x)
calculate(t, s, x)


(t, interval, eat) = map(int, input().split())
if eat < t:
	print('NO')
elif eat == t:
	print('YES')
elif eat > t and eat < t + interval:
	print('NO')
elif (eat - t) % interval > 1:
	print('NO')
else:
	print('YES')


import sys

def main():
	(t, s, x) = sys.stdin.readline().strip().split(' ')
	t = int(t)
	s = int(s)
	x = int(x)
	result = 'YES' if solve(t, s, x) else 'NO'
	sys.stdout.write(result + '\n')

def solve(t, s, x):
	if t == x:
		return True
	if x < t + s:
		return False
	if (x - t) % s == 0:
		return True
	if (x - t - 1) % s == 0:
		return True
	return False
main()


(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
elif x < s + t:
	print('NO')
else:
	val = (x - t) % s
	if val <= 1:
		print('YES')
	else:
		print('NO')


(a, b, c) = list(map(int, input().split()))
if c > a:
	c -= a
	if c != 1:
		c %= b
		if c == 0 or c == 1:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
elif c == a:
	print('YES')
else:
	print('NO')


(a, b, c) = map(int, input().split())
if c < a:
	print('NO')
elif not (c - a) % b or (not (c - a - 1) % b and c > a + 1):
	print('YES')
else:
	print('NO')


import sys
t = input().split()
(t, s, x) = (int(t[0]), int(t[1]), int(t[2]))
if x < t or 0 < x - t < s:
	print('NO')
	sys.exit(0)
if x == t:
	print('YES')
	sys.exit(0)
if (x - t) % s in [0, 1]:
	print('YES')
else:
	print('NO')


def main():
	(t, s, x) = (int(x) for x in input().split())
	print(solver(t, s, x))

def solver(t, s, x):
	mod1 = t % s
	mod2 = (t + 1) % s
	test = x % s
	if x < t or x == t + 1 or test not in (mod1, mod2):
		return 'NO'
	else:
		return 'YES'
main()


from math import ceil
(t, s, x) = map(int, input().split())
y = (x - t) / s
z = (x - t - 1) / s
if y >= 0 and int(y) == ceil(y) or (z > 0 and int(z) == ceil(z)):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
ans = False
if x == t:
	ans = True
elif x >= t + s and (x - t) % s == 0:
	ans = True
elif x >= t + s and (x - t) % s == 1:
	ans = True
print(ans and 'YES' or 'NO')


(t, s, x) = list(map(int, input().split()))
if t == x:
	print('YES')
	exit()
if x < s + t:
	print('NO')
	exit()
if (x - t) % s == 0 or (x - t - 1) % s == 0:
	print('YES')
else:
	print('NO')


(t, s, x) = list(map(int, input().split()))
r = (x - t) % s
if r == 0 and x >= t or (r == 1 and x > t + 1):
	print('YES')
else:
	print('NO')


(t, s, x) = list(map(int, input().split()))
if x - t > 1000:
	if (x - t) % s == 0 or (x - t - 1) % s == 0:
		print('YES')
	else:
		print('NO')
else:
	a = [t]
	i = 1
	k = 0
	while t + i * s <= x:
		k = t + i * s
		a.append(k)
		a.append(k + 1)
		i += 1
	if x in a:
		print('YES')
	else:
		print('NO')


import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def printARR(arr):
	for e in arr:
		print(e, end=' ')
	print()

def main():
	(t, s, x) = M()
	tmp = x - t
	if x == t + 1:
		print('NO')
		return
	if tmp < 0:
		print('NO')
		return
	if tmp == 0:
		print('YES')
		return
	if tmp % s == 0 or (tmp - 1) % s == 0:
		print('YES')
		return
	else:
		print('NO')
tc = 1
for _ in range(tc):
	main()


from collections import Counter

def si():
	return str(input())

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
(t, s, x) = mi()
a = t + s
b = t + s + 1
if a > x:
	if x == t:
		print('YES')
	else:
		print('NO')
elif (x - a) % s == 0 or (x - b) % s == 0:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x >= t and (x - t) % s <= 1 and (x != t + 1):
	print('YeS')
else:
	print('nO')


(t, s, x) = map(int, input().split(' '))
ret = 'NO'
x = x - t
if x >= 0 and x % s == 0:
	ret = 'YES'
if x - 1 - s >= 0 and (x - 1 - s) % s == 0:
	ret = 'YES'
print(ret)


inp = input().split()
s = eval(inp[1])
x = eval(inp[2]) - eval(inp[0])
if (x % s == 0 or ((x - 1) % s == 0 and x - 1 != 0)) and x >= 0:
	print('YES')
else:
	print('NO')


def main():
	(t, s, x) = map(int, input().split())
	if x >= t:
		a = x - t
		if a >= 0:
			a1 = 1
		b = a // s
		c = a % s
		if b == 0 and a1 == 1:
			if c == 0:
				print('YES')
			else:
				print('NO')
		elif b > 0 and a1 == 1:
			if c == 0:
				print('YES')
			elif c == 1:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	else:
		print('NO')
main()


(start, interval, eattime) = (int(_) for _ in input().split())
if eattime == start or (eattime >= start + interval and (eattime - start) % interval <= 1):
	print('YES')
else:
	print('NO')


from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def sol():
	(t, s, x) = list(map(int, input().split()))
	if (x % s == t % s or (x - 1) % s == t % s) and x >= t:
		if x == t + 1 and s != 1:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')
sol()


(t, s, x) = input().strip().split()
t = int(t)
s = int(s)
x = int(x)
if x < t:
	print('NO')
else:
	x = x - t
	if x >= s or x == 0:
		if x % s == 1 or x % s == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
	exit(0)
if x < t:
	print('NO')
	exit(0)
t += s
d = int((x - t) / s)
if d > 0:
	d -= 1
x -= d * s
while t <= x:
	if t == x or t + 1 == x:
		print('YES')
		exit(0)
	t += s
print('NO')


data = input().split()
t = int(data[0])
s = int(data[1])
x = int(data[2])
if x == t:
	print('YES')
elif (x - t) / s % 1 == 0 and x - t > 0:
	print('YES')
elif (x - t - 1) / s % 1 == 0 and x - t - 1 > 0:
	print('YES')
else:
	print('NO')


l = list(map(int, input().split(' ')))
t = l[0]
s = l[1]
x = l[2]
if x == t:
	print('YES')
elif (x - t) % s == 0 and x - t > 0 or ((x - t - 1) % s == 0 and x - t - 1 > 0):
	print('YES')
else:
	print('NO')


data = [int(information) for information in input().split(' ')]
number1 = (data[2] - data[0]) / data[1]
number2 = (data[2] - data[0] - 1) / data[1]
if (float(int(number1)) == number1 or float(int(number2)) == number2) and (number2 != 0 and data[2] >= data[0]):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
r = x - t
if r == 0:
	print('yes')
elif r >= s:
	if r % s == 0 or r % s == 1:
		print('yes')
	else:
		print('no')
else:
	print('no')


(t, s, x) = map(int, input().split())
if x < t or x == t + 1:
	print('NO')
elif x == t:
	print('YES')
else:
	r = (x - t) % s
	if r < 2:
		print('YES')
	else:
		print('NO')


(start, increment, check) = [int(x) for x in input().split(' ')]
f = (check - start) // increment - 1
l = (check - start) // increment + 1
out = []
for i in range(f, l):
	out.append(start + i * increment)
other = [x + 1 for x in out if x != start]
if check < start:
	print('NO')
elif check in out or check in other:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
m = t
n = t + 1
flag = 0
if x < t:
	print('NO')
	flag = 1
elif x == t:
	print('YES')
	flag = 1
elif x == t + 1:
	print('NO')
	flag = 1
while x > n:
	m += s
	n += s
	if x == m or x == n:
		print('YES')
		flag = 1
if flag == 0:
	print('NO')


inputs = list(map(int, str(input()).split(' ')))
(t, s, x) = inputs
dx = x - t
print((dx == 0 or (dx >= s and dx % s in [0, 1])) and 'YES' or 'NO')


(a, b, c) = input().split()
(prvni, interval, jist) = [int(a), int(b), int(c)]
if jist >= prvni and jist != prvni + 1 and ((jist - prvni) % interval == 0 or (jist - prvni - 1) % interval == 0):
	print('YES')
else:
	print('NO')


import sys
(initialTime, skip, goal) = map(int, input().split())
if initialTime == goal:
	print('YES')
	sys.exit()
x = goal - initialTime
if x >= skip:
	if x % skip == 0 or x % skip == 1:
		print('YES')
		sys.exit()
	else:
		print('NO')
else:
	print('NO')


__author__ = 'Utena'
(t, s, x) = map(int, input().split())
if x >= t:
	if not x - t == 1:
		if (x - t) % s == 0 or (x - t - 1) % s == 0:
			print('YES')
			exit(0)
	elif (x - t) % s == 0:
		print('YES')
		exit(0)
print('NO')


(t, s, x) = map(int, input().strip().split())
(s1, s2) = ((x - t) / s, (x - t - 1) / s)
if s1 == int(s1) and s1 >= 0 or (s2 == int(s2) and s2 >= 1):
	print('YES')
else:
	print('NO')


import sys
(t, s, x) = map(int, input().split())
if x < t:
	print('NO')
	sys.exit(0)
if x == t:
	print('YES')
	sys.exit(0)
x -= t
if x % s == 0 or (x % s == 1 and x != 1):
	print('YES')
	sys.exit(0)
print('NO')


(t, s, x) = map(int, input().split())
print('YNEOS'[1 - bool(x == t or (((x - t) % s == 0 or (x - t - 1) % s == 0) and (x - t) // s > 0))::2])


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


(t, s, x) = (int(z) for z in input().split())
x -= t
if x >= 0 and x % s in [0, 1] and (x != 1):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x - t >= 0:
	z = (x - t) % s
else:
	z = 1
if x - t > 1:
	z1 = (x - t - 1) % s
else:
	z1 = 1
if z == 0 or z1 == 0:
	print('YES')
else:
	print('NO')


(a, b, c) = map(int, input().split())
k = c - a
if k >= b or k == 0:
	if k % b == 0 or k % b == 1:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def IsInteger(x):
	return x % 1 == 0
(t, s, x) = input().strip().split()
t = int(t)
s = int(s)
x = int(x)
if x - t < 0:
	print('NO')
elif x - t == 0:
	print('YES')
elif IsInteger((x - t) / s):
	print('YES')
elif x - t - 1 != 0 and IsInteger((x - t - 1) / s):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
f1 = (x - t) % s == 0 and x >= t
f2 = (x - t - 1) % s == 0 and x > t + 1
print('YES' if f1 or f2 else 'NO')


def main():
	(t, s, x) = map(int, input().split())
	if x == t:
		print('YES')
		return
	if x == t + 1 or x < t:
		print('NO')
		return
	if (x - t) % s == 0:
		print('YES')
	elif (x - t - 1) % s == 0:
		print('YES')
	else:
		print('NO')
main()


def main():
	(t, s, x) = [int(x) for x in input().split()]
	time = x - t
	if time < s and time != 0:
		print('NO')
		return
	if time == 0:
		print('YES')
		return
	print('YES' if time % s == 0 or time % s == 1 else 'NO')
main()


a = input().split(' ')
t = int(a[0])
s = int(a[1])
x = int(a[2])
if x == t:
	print('YES')
elif x >= t + s and 0 in {(x - t) % s, (x - t - 1) % s}:
	print('YES')
else:
	print('NO')


3

def main():
	(t, s, x) = list(map(int, input().split()))
	if x == t:
		print('YES')
		return
	x -= t + s
	if x >= 0 and x % s == 0 or (x >= 1 and (x - 1) % s == 0):
		print('YES')
	else:
		print('NO')
main()


(t, s, x) = map(int, input().split())
l = (x - t) % s
print('YES' if l in (0, 1) and x != t + 1 and (x >= t) else 'NO')


import math
(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
elif x < t + s:
	print('NO')
else:
	n = math.ceil((x - t - 1) / s)
	d = t + n * s + 1
	if d == x or x == d - 1:
		print('YES')
	else:
		print('NO')


(t, s, x) = list(map(int, input().split()))
if x == t:
	print('YES')
	return
if x < t:
	print('NO')
	return
t += s
d = int((x - t) / s)
if d > 0:
	d -= 1
x -= d * s
while t <= x:
	if t == x or t + 1 == x:
		print('YES')
		return
	t += s
print('NO')


k = list(map(int, input().split()))
(t, s, x) = (k[0], k[1], k[2])
p = (x - t) / s + 1
q = (x - t - 1 - s) / s + 1
if p == int(p) and p > 0:
	print('YES')
elif q == int(q) and q > 0:
	print('YES')
else:
	print('NO')


import math
(t, s, x) = list(map(int, input().split()))
n = math.floor((x - t) / s)
if x < t:
	print('NO')
elif n * s + t == x or (n * s + 1 + t == x and n * s + t > t):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x < t + s:
	if x == t:
		print('YES')
	else:
		print('NO')
else:
	x -= t + s
	if x % s < 2:
		print('YES')
	else:
		print('NO')


(t, s, x) = map(int, input().split())
if t > x:
	print('NO')
	exit()
time_1 = x - t
time_2 = x - t - 1
if time_1 % s == 0 or (time_2 % s == 0 and time_2 != 0):
	print('YES')
else:
	print('NO')


import sys, math
(t, s, x) = map(int, input().split())
compare = x - t
if compare != 0:
	compare -= s
if compare > 1:
	compare %= s
if compare == 0:
	print('YES')
elif compare == 1:
	print('YES')
else:
	print('NO')


X = list(map(int, input().split()))
if X[2] < X[0]:
	print('NO')
	exit()
if (X[2] - X[0]) % X[1] == 0 or ((X[2] - X[0] - 1) // X[1] != 0 and (X[2] - X[0] - 1) % X[1] == 0):
	print('YES')
	exit()
print('NO')


(t, s, x) = map(int, input().split())
x -= t
print(['NO', 'YES'][x >= s and x % s in [0, 1] or x == 0])


(t, s, x) = map(int, input().split())
k2 = (x - t - 1) / s
k = (x - t) / s
if x == t:
	print('YES')
elif x < t or k2 == 0:
	print('NO')
elif k2 % 1 == 0 or k % 1 == 0:
	print('YES')
elif k.is_integer() == False or k2.is_integer == False:
	print('NO')


import math
inp = input().split()
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
if a == c:
	print('YES\n')
elif c - b < a:
	print('NO\n')
elif (c - a) % b == 0 or (c - a) % b == 1:
	print('YES\n')
else:
	print('NO\n')


import math
(t, s, x) = input().split()
t = int(t)
s = int(s)
x = int(x)
n1 = float((x - t) / s)
n2 = float((x - t - 1) / s)
if x < t:
	print('NO')
elif x == t or n1 == math.floor(n1) or (n2 == math.floor(n2) and n2 != 0):
	print('YES')
else:
	print('NO')


def get(val):
	global t, s
	if val == 0:
		return t
	val += 1
	if val % 2 == 1:
		return t + val // 2 * s + 1
	else:
		return t + val // 2 * s
(t, s, x) = list(map(int, input().split()))
le = 0
ri = 10 ** 9 + 500
while ri - le > 1:
	mid = (le + ri) // 2
	val = get(mid)
	if val > x:
		ri = mid
	else:
		le = mid
if get(le) == x:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
a1 = t
a2 = t + s + 1
if (x - a1) % s == 0 and int((x - a1) / s) >= 0 or ((x - a2) % s == 0 and int((x - a2) / s) >= 0):
	print('YES')
else:
	print('NO')


liste = input().split()
for i in range(len(liste)):
	liste[i] = int(liste[i])
a = liste[2] - liste[0]
b = liste[1]
if a < 0:
	print('NO')
elif a % b == 0:
	print('YES')
elif a - b < 0:
	print('NO')
elif a % b == 1:
	print('YES')
else:
	print('NO')


__author__ = 'Alexander'
import sys
(t, s, x) = map(int, sys.stdin.readline().split())
if x == t:
	sys.stdout.write('YES')
elif x < t:
	sys.stdout.write('NO')
elif x == t + 1 and s != 1:
	sys.stdout.write('NO')
elif x % s != t % s and x % s != (t + 1) % s:
	sys.stdout.write('NO')
else:
	sys.stdout.write('YES')


(t, s, x) = map(int, input().split())
if x >= t:
	if t + s <= x:
		y1 = (x - t) / s
		y2 = (x - t - 1) / s
		if int(y1) == y1:
			print('YES')
		elif int(y2) == y2:
			print('YES')
		else:
			print('NO')
	elif x == t:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])
condition = c - a == 0 or c - a >= b
if (c - a) % b <= 1 and condition:
	print('YES')
else:
	print('NO')


(t, s, a) = map(int, input().split())
a -= t
if (a % s == 0 or (a - 1) % s == 0) and a >= 0 and (a - 1 != 0):
	print('YES')
else:
	print('NO')


(n, s, v) = map(int, input().split())
if n == v:
	print('YES')
else:
	x = (v - n) / s
	y = (v - n - 1) / s
	if x == int(x) and x > 0:
		print('YES')
	elif y == int(y) and y > 0:
		print('YES')
	else:
		print('NO')


(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
elif x > t and (x - t) // s > 0 and ((x - t) % s < 2):
	print('YES')
else:
	print('NO')


(t, s, x) = [int(x) for x in input().split()]
if x == t:
	print('YES')
else:
	t += s
	k = x - t
	if k < 0:
		print('NO')
	else:
		(i, j) = (k / s, (k - 1) / s)
		if i % 1 == 0 or j % 1 == 0:
			print('YES')
		else:
			print('NO')


def pineapple(t, s, x):
	flag = 0
	if x == t:
		flag = 1
	if x == t + 1:
		return 'NO'
	count = x - t
	if count < 0:
		return 'NO'
	if count % s == 0:
		flag = 1
	if (count - 1) % s == 0:
		flag = 1
	if flag:
		return 'YES'
	return 'NO'
(T, S, X) = [int(i) for i in input().split()]
print(pineapple(T, S, X))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(t, s, x) = LI()
	if x == t:
		return 'YES'
	if x < t + s:
		return 'NO'
	if (x - t) % s < 2:
		return 'YES'
	return 'NO'
print(main())


(fisrt_bark, interval_bark, eat_time) = map(int, input().split())
if fisrt_bark > eat_time:
	print('NO')
elif fisrt_bark == eat_time:
	print('YES')
else:
	time = (eat_time - fisrt_bark) % interval_bark
	if (time == 0 or time == 1) and eat_time != fisrt_bark + 1:
		print('YES')
	else:
		print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
sys.setrecursionlimit(10 ** 5)
(t, s, x) = get_int_list()
if x < t:
	print('NO')
elif t == x:
	print('YES')
elif (x - t) % s == 0 and (x - t) // s > 0 or ((x - t - 1) % s == 0 and (x - t - 1) // s > 0):
	print('YES')
else:
	print('NO')


import sys
n = input().rstrip().split()
inn = list(map(int, n))
t = inn[0]
i = 1
div = 0
if t == inn[2]:
	print('YES')
	sys.exit()
if inn[1] > inn[2]:
	print('NO')
	sys.exit()
if inn[0] > inn[2]:
	print('NO')
	sys.exit()
sub = inn[2] - t
if sub - 1 == 0:
	print('NO')
	sys.exit()
if sub % inn[1] == 0 or (sub - 1) % inn[1] == 0:
	print('YES')
	sys.exit()
else:
	print('NO')


(T, S, X) = list(map(int, input().rstrip().split(' ')))
if T == X:
	print('YES')
	exit()
T += S
if T <= X and (X % S == T % S or X % S == (T + 1) % S):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, str.split(input()))
print(['NO', 'YES'][x == t or (x >= t + s and (x - t) % s < 2)])


(t, s, x) = input().split(' ')
t = int(t)
s = int(s)
x = int(x)
temp = x - t
if t == x:
	print('YES')
elif x < t:
	print('NO')
elif x == t + 1:
	print('NO')
elif temp % s == 0 or temp % s == 1:
	print('YES')
else:
	print('NO')


(t, s, x) = list(map(int, input().split()))
if x == t or (x >= t + s and (x - t) % s < 2):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
c1 = x - t - 1 - s
c2 = x - t
if c1 % s == 0 and c1 >= 0 or (c2 % s == 0 and c2 >= 0):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
p1 = (x - t) / s
p2 = (x - 1 - t) / s
if p1 == int(p1) and p1 >= 0 or (p2 == int(p2) and p2 > 0):
	print('YES')
else:
	print('NO')


a = list(map(int, input().split()))
if a[0] > a[2]:
	print('NO')
elif abs(a[2] - a[0]) % a[1] == 1 and abs(a[2] - a[0]) != 1 or (abs(a[2] - a[0]) % a[1] == 0 and abs(a[2] - a[0]) != 1):
	print('YES')
else:
	print('NO')


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
inf = 1e+18
div = 998244353
(t, s, x) = value()
ans = 'NO'
if x == t or ((x - t) // s > 0 and (x - t) % s == 0) or ((x - t - 1) // s > 0 and (x - t - 1) % s == 0):
	ans = 'YES'
print(ans)


from math import ceil as c
(t, s, x) = map(int, input().split())
(h, k) = ((x - t) / s, (x - t - 1) / s)
if k > 0 and int(k) == c(k) or (h >= 0 and int(h) == c(h)):
	print('YES')
else:
	print('NO')


leer = input()
leer = leer.split(' ')
for i in range(0, 3):
	leer[i] = int(leer[i])
result = (int(leer[2]) - int(leer[0])) % int(leer[1])
if leer[2] < leer[0]:
	print('NO')
elif result == 1 and leer[2] - leer[0] < leer[1]:
	print('NO')
elif result == 0 or result == 1:
	print('YES')
else:
	print('NO')


(t, s, x) = input().split()
(t, s, x) = (float(t), float(s), float(x))
n1 = float((x - t) / s)
n2 = float((x - t - 1) / s)
if n1 - int(n1) == 0 and n1 >= 0 or (n2 - int(n2) == 0 and n2 > 0):
	print('YES')
else:
	print('NO')


s = input().split()
a = int(s[2]) - int(s[0])
print('YES' if a != 1 and a >= 0 and (a % int(s[1]) < 2) else 'NO')


def f(l):
	(t, s, x) = l
	d = x - t
	return d == 0 or (d >= s and d % s < 2)
l = list(map(int, input().split()))
print('YES' if f(l) else 'NO')


(t, s, x) = map(int, input().split())
(q, r) = divmod(x - t, s)
print(('NO', 'YES')[q == 0 and r == 0 or (q > 0 and r <= 1)])


from math import ceil
Input = lambda : map(int, input().split())
l = list(Input())
if l[0] == l[2]:
	print('YES')
	exit()
i = (l[2] - l[0]) / l[1]
j = (l[2] - l[0] - 1) / l[1]
if i > 0 and ceil(i) == i or (j > 0 and ceil(j) == j):
	print('YES')
else:
	print('NO')


(t, s, k) = map(int, input().split())
if k < t or k - t == 1:
	print('NO')
elif k == t:
	print('YES')
else:
	k -= t
	print('YES' if k % s == 0 or k % s == 1 else 'NO')


(a, b, c) = map(int, input().split())
i = a
d = 'NO'
while c >= i:
	if i == c:
		print('YES')
		exit()
	else:
		d = 'NO'
	i = i + b
i = a + b + 1
while c >= i:
	if i == c:
		print('YES')
		exit()
	else:
		d = 'NO'
	i = i + b
print(d)


read = lambda : map(int, input().split())
(t, s, x) = read()
f1 = (x - t) % s == 0 and x >= t
f2 = (x - t - 1) % s == 0 and x > t + 1
print('YES' if f1 or f2 else 'NO')
if t == 10 ** 9:
	print(1 / 0)


(t, s, x) = map(int, input().split())
ok = 'NO'
if t <= x:
	k = x - t
	if t == x or k % s == 0 or k % s == 1:
		ok = 'YES'
	if k == 1 and s > 1:
		ok = 'NO'
print(ok)


import sys
input = sys.stdin.buffer.readline
(t, s, x) = map(int, input().split())
if t == x:
	print('YES')
elif x < t:
	print('NO')
elif x - t < s:
	print('NO')
elif (x - t) % s == 0 or (x - t) % s == 1:
	print('YES')
else:
	print('NO')


(t, x, s) = map(int, input().split())
k = int((s - t) / x)
if t + k * x == s and k > -1:
	print('YES')
elif k > 0 and t + k * x + 1 == s:
	print('YES')
else:
	print('NO')


from math import ceil
(t, s, x) = map(int, input().split())
if x > t + 1:
	if (x - t) % s == 0 or (x - t - 1) % s == 0:
		print('YES')
	else:
		print('NO')
elif x == t:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())

def barking(t, s, x):
	if t == x:
		return 'YES'
	while t < x:
		t += s
		if t == x or t + 1 == x:
			return 'YES'
		if x < t:
			return 'NO'
	return 'NO'
print(barking(t, s, x))


(a, d, p) = map(int, input().split())
q = p - a
if p < a + d:
	if q == 0:
		print('YES')
	else:
		print('NO')
elif q % d == 0 or q % d == 1:
	print('YES')
else:
	print('NO')


def solve():
	(t, s, x) = [int(y) for y in input().split()]
	if x == t:
		return True
	if x >= s + t and (x - t) % s == 0:
		return True
	if x >= s + t + 1 and (x - t - 1) % s == 0:
		return True
	return False

def main():
	print(solve() and 'YES' or 'NO')
main()


(t, s, x) = [int(n) for n in input().split()]
r = (x - t) % s
if x < t:
	print('NO')
elif r == 0 or (r == 1 and x != t + 1):
	print('YES')
else:
	print('NO')


line = input().split()
t = int(line[0])
s = int(line[1])
x = int(line[2])
x = x - t
if x >= 0 and (x % s == 0 or (x != 1 and (x - 1) % s == 0)):
	print('YES')
else:
	print('NO')


import math, fractions
(t, s, x) = [int(x) for x in input().split()]
acc = t
acc1 = acc
i = 1
if acc + s <= x:
	acc = (x - t) // s * s + t
	acc1 = acc + 1
print('YES' if acc == x or acc1 == x else 'NO')


(a, b, c) = map(int, input().split())
if c < a:
	print('NO')
elif (c - a) % b == 0 and c - a != 1:
	print('YES')
elif (c - a - 1) % b == 0 and c - a != 1:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
	exit()
elif x < t or (x == t + 1 and s != 1):
	print('NO')
	exit()
else:
	i = t
	while i < x:
		i += s
	if i == x or i + 1 == x or i - s == x or (i - s + 1 == x):
		print('YES')
	else:
		print('NO')


(x, y, z) = [int(a) for a in input().split()]
if x == z:
	print('YES')
	quit()
xx = x
while xx < z:
	xx = xx + y
	if xx == z or xx + 1 == z:
		print('YES')
		quit()
if xx == z or xx + 1 == z:
	print('YES')
else:
	print('NO')


import sys
(t, s, x) = list(map(int, input().split()))
if t == x:
	print('YES')
	sys.exit()
elif x < s + t:
	print('NO')
	sys.exit()
else:
	x1 = x - t
	x2 = x - t - 1
	if x1 % s == 0 or x2 % s == 0:
		print('YES')
	else:
		print('NO')


n = [int(i) for i in input().split(' ')]
t = n[0]
s = n[1]
x = n[2]
a = (x - t) / s
b = (x - t - 1) / s
if x < t:
	print('NO')
elif x == t:
	print('YES')
elif x - t != 0 and x - t - 1 != 0:
	if a == int(a) or b == int(b):
		print('YES')
	else:
		print('NO')
else:
	print('NO')


(t, s, x) = str(input()).split()
t = int(t)
s = int(s)
x = int(x)
if x - s >= t and (x - s - t) % s < 2 or x == t:
	print('YES')
else:
	print('NO')


def barking(t, s, x):
	if x < t:
		return False
	x -= t
	if x % s == 0:
		return True
	if x > 1 and x % s == 1:
		return True
	return False
(t, s, x) = map(int, input().split())
print('YES' if barking(t, s, x) else 'NO')


(t, s, x) = [int(x) for x in input().split()]
if t == x:
	print('YES')
	exit(0)
if x - t > 0 and (x - t) % s == 0:
	print('YES')
	exit(0)
if x - t - 1 > 0 and (x - t - 1) % s == 0:
	print('YES')
	exit(0)
print('NO')


(t, s, x) = map(int, input().split())
if x >= t:
	if x == t:
		print('Yes')
	elif x == t + 1 and s != 1:
		print('No')
	elif (x - t) % s == 0 or (x - t - 1) % s == 0:
		print('Yes')
	else:
		print('No')
else:
	print('No')


def f(t, s, x):
	if x < s + t:
		if x == t:
			print('YES')
		else:
			print('NO')
	elif (x - t) % s in (0, 1):
		print('YES')
	else:
		print('NO')
f(*map(int, input().split()))


(t, s, x) = list(map(int, input().split()))
f = False
if x - 1 > t and (x - 1 - t) % s == 0:
	f = True
if x >= t and (x - t) % s == 0:
	f = True
if f:
	print('YES')
else:
	print('NO')


import math

def solve(t, s, x):
	if x < t:
		return 'NO'
	if x == t:
		return 'YES'
	if x < t + s:
		return 'NO'
	if (x - t) % s == 0 or (x - t - 1) % s == 0:
		return 'YES'
	return 'NO'

def main():
	arr = list(map(int, input().split(' ')))
	print(solve(*arr))
main()


(t, s, x) = map(int, input().split())
n1 = x - t
n1 /= s
n2 = x - t - 1
n2 /= s
if t + s > x:
	if x == t:
		print('YES')
	else:
		print('NO')
elif n1 == int(n1) or n2 == int(n2):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
if x < t + s:
	if t == x:
		print('YES')
	else:
		print('NO')
elif x >= t + s:
	f = x - t
	k = f // s
	g = k * s
	m = g + t
	if m == x or m + 1 == x:
		print('YES')
	else:
		print('NO')


def get_int():
	return map(int, input().split())
(t, s, x) = get_int()
print(['NO', 'YES'][((x - t) / s == (x - t) // s or ((x - t - 1) // s > 0 and (x - t - 1) / s == (x - t - 1) // s)) and x >= t])


(t, s, x) = map(int, input().split())
if x == t:
	print('YES')
	exit(0)
elif x > t:
	if (x - t) % s == 0 and (x - t) / s >= 1:
		print('YES')
		exit(0)
	if (x - t - 1) % s == 0 and (x - t - 1) / s >= 1:
		print('YES')
		exit(0)
print('NO')


def R():
	return map(int, input().split())

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
(t, s, x) = R()
if x >= t and (x - t) % s == 0 or (x >= t + s + 1 and (x - t - 1) % s == 0):
	print('YES')
else:
	print('NO')


(T, S, X) = list(map(int, input().split()))
if X < T:
	print('NO')
elif (X - T) % S == 1 or (X - T) % S == 0:
	if X == T + 1:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


(t, s, x) = list(map(int, input().split()))
z = 'NO'
y = 'YES'
a = 1
if x < t:
	a = z
elif x == t:
	a = y
elif x == t + 1:
	if s > 1:
		a = z
	else:
		a = y
elif (x - t) % s == 0 or (x - t - 1) % s == 0:
	a = y
else:
	a = z
print(a)


(t, s, x) = map(int, input().split())
(l, k) = ((x - t) % s, (x - t) // s)
print(('NO', 'YES')[x >= t and (l == 0 or (l == 1 and k > 0))])


(t, s, x) = [int(y) for y in input().split(' ')]
if x >= t and (x - t) % s <= 1 and (x != t + 1):
	ans = 'YES'
else:
	ans = 'NO'
print(ans)


def main():
	(t, s, x) = map(int, input().split())
	if t == x:
		return 'YES'
	roger = (x - t) / s
	roger2 = (x - (t + 1)) / s
	if (roger % 1 == 0 or roger2 % 1 == 0) and (roger >= 1 or roger2 >= 1):
		return 'YES'
	else:
		return 'NO'
print(main())


(t, s, x) = input().split()
(t, s, x) = (int(t), int(s), int(x))
if t == x:
	print('YES')
else:
	t += s
	if t > x:
		print('NO')
	else:
		x = x - t
		jumps = x // s
		t1 = jumps * s
		t2 = t1 + 1
		if t1 == x or t2 == x:
			print('YES')
		else:
			print('NO')


import sys
container2 = []
(t, s, x) = map(int, input().split())
a = (x - t) // s
b = max(0, a - 10)
c = 0
for i in range(b, a + 10):
	if x == t + i * s or x == t + 1 + (i + 1) * s:
		print('YES')
		c = 1
		sys.exit()
if c == 0:
	print('NO')


(t, s, x) = map(int, input().split())
if x < t:
	print('NO')
else:
	(div_, mod_) = divmod(x - t, s)
	print('YES' if mod_ == 0 or (mod_ == 1 and div_ > 0) else 'NO')


import sys
inp = sys.stdin.readline().split()
t = int(inp[0])
s = int(inp[1])
x = int(inp[2])

def fn():
	if x == t:
		return 'YES'
	if x < s + t:
		return 'NO'
	if (x - t) % s <= 1:
		return 'YES'
	return 'NO'
print(fn())


def woof(t, s, x):
	check = 'NO'
	if x == t:
		check = 'YES'
	else:
		n1 = x - t
		n2 = x - t - 1
		if n1 > 0 and n1 % s == 0 or (n2 > 0 and n2 % s == 0):
			check = 'YES'
	return check
s1 = input()
i = 0
(t, s, x) = ('', '', '')
spaces = []
spaces.append(s1.find(' '))
z = s1.find(' ')
t = s1[0:z]
s1 = s1[z + 1:len(s1)]
z = s1.find(' ')
s = s1[0:z]
s1 = s1[z + 1:len(s1)]
x = s1[0:len(s1)]
print(woof(int(t), int(s), int(x)))


(a, b, c) = map(int, input().split())
d = (c - a) // b
if a == c or (d > 0 and ((c - a) % b == 0 or (c - a) % b == 1)):
	print('YES')
else:
	print('NO')


def main():
	s = input()
	p = []
	for i in s.split(' '):
		p.append(int(i))
	(t, s, x) = (p[0], p[1], p[2])
	res = False
	if t == x:
		res = True
	if t + 1 != x:
		if t <= x and ((x - t) % s == 0 or (x - t - 1) % s == 0):
			res = True
	if res:
		print('YES')
	else:
		print('NO')
main()


(t, s, x) = map(int, input().split())
r = 0
while t <= x:
	if t == x:
		r = 1
		break
	else:
		t += s
	if t + 1 == x:
		r = 1
		break
print('NO' if r == 0 else 'YES')


import sys
arr = list(map(int, input().split()))
t = arr[0]
s = arr[1]
x = arr[2]
if x == t or ((x - t) % s == 0 and x >= t + s) or ((x - t - 1) % s == 0 and x >= t + s + 1):
	print('YES')
else:
	print('NO')


def main():
	(t, s, x) = map(int, input().split())
	print(('NO', 'YES')[x == t or (x >= t + s and (x - t) % s < 2)])
main()


l1 = [int(x) for x in input().split()]
(t, s, x) = (l1[0], l1[1], l1[2])
if x == t or (x - t > 0 and (x - t) % s == 0) or (x - t - 1 > 0 and (x - t - 1) % s == 0):
	print('YES')
else:
	print('NO')


(t, s, x) = [int(i) for i in input().split()]
d = x - t
e = d % s
if t < 0:
	print('NO')
elif d < 0:
	print('NO')
elif x == t + 1:
	print('NO')
elif e in [0, 1]:
	print('YES')
else:
	print('NO')


f = lambda : map(int, input().split())
(t, s, x) = f()
if x < t:
	print('NO')
elif t <= x < t + s:
	print('YNEOS'[x != t::2])
else:
	print('YES' if (x - t) % s in [0, 1] else 'NO')


import math
(t, s, x) = map(int, input().split())
if x < t:
	print('NO')
else:
	x -= t
	if x > 0 and x < s:
		print('NO')
	elif x % s not in [0, 1]:
		print('NO')
	else:
		print('YES')


(t, s, x) = list(map(int, input().split()))
dxt = x - t
if dxt == 0:
	print('YES')
elif dxt < 0 or dxt - 1 == 0:
	print('NO')
elif dxt % s == 0 or (dxt - 1) % s == 0:
	print('YES')
else:
	print('NO')


tsx = list(map(int, input().split()))
if ((tsx[2] - tsx[0]) % tsx[1] == 0 or (tsx[2] - tsx[0]) % tsx[1] == 1) and (tsx[2] - tsx[0]) // tsx[1] >= 1:
	print('YES')
elif tsx[2] == tsx[0]:
	print('YES')
else:
	print('NO')


(a, b, c) = map(int, input().split())
res = 'NO'
if not c < a + b:
	if (c - (a + b)) % b == 0 or (c - (a + b)) % b == 1:
		res = 'YES'
elif a == c:
	res = 'YES'
print(res)


(t, s, x) = map(int, input().split())
a = x - t
if x == t or (a % s < 2 and a >= s):
	print('yes')
else:
	print('no')


import math
(t, s, x) = [int(x) for x in input().split()]
a = (x - t) / s
b = (x - t - 1) / s
if x == t:
	print('YES')
elif a > 0 and b > 0 and (math.ceil(a) == math.floor(a) or math.ceil(b) == math.floor(b)):
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
a = x // s
if x == t:
	print('YES')
elif s + t <= x and (x - t - s) % s <= 1:
	print('YES')
else:
	print('NO')


def p1():
	l = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
	a = []
	for i in range(15):
		print(l[i])
		a.append(input())
	if a.count('yes') >= 2:
		print('composite')
	elif a.count('yes') == 0:
		print('prime')
	elif a.count('yes') == 1:
		i = 0
		for j in range(15):
			if a[j] == 'yes':
				i = j
				break
		print(l[i] * l[i])
		b = input()
		if b == 'yes':
			print('composite')
		else:
			print('prime')

def p2():
	n = int(input())
	a = ''
	b = 1
	while len(a) < n:
		a = a + str(b)
		b = b + 1
	print(a[n - 1])

def p3():
	n = int(input())
	print(n // 7 * 2, n // 7 * 2 + min(2, n % 7))

def p4():
	(a, b, c) = [int(i) for i in input().split()]
	if a > c:
		print('NO')
	elif a == c:
		print('YES')
	elif c - a >= b and ((c - a) % b == 0 or (c - a) % b == 1):
		print('YES')
	else:
		print('NO')

def p5():
	(a, b) = input().split()
	if a == b:
		print(a)
	else:
		print(1)
p4()


(a, b, c) = input().split()
t = int(a)
s = int(b)
x = int(c)
if x < t:
	print('NO')
else:
	x -= t
	if x == 1:
		print('NO')
	else:
		x %= s
		if x == 0 or x == 1:
			print('YES')
		else:
			print('NO')


import sys
import math
import bisect
import itertools
import random
import re

def solve(t, s, x):
	if x == t:
		return True
	if x >= t + s and (x - t) % s == 0:
		return True
	if x >= t + s and (x - t) % s == 1:
		return True
	return False

def main():
	(t, s, x) = map(int, input().split())
	if solve(t, s, x):
		print('YES')
	else:
		print('NO')
main()


i = input().split()
for j in range(3):
	i[j] = int(i[j])
if (i[2] + i[1] - i[0]) % i[1] == 0 and i[2] >= i[0]:
	print('YES\n')
else:
	i[2] -= 1
	if (i[2] + i[1] - i[0]) % i[1] == 0 and i[2] != i[0] and (i[2] >= i[0]):
		print('YES\n')
	else:
		print('NO\n')


(t, s, x) = map(int, input().split())
flag = False
if x == t:
	flag = True
elif x > t:
	x -= t
	(d, r) = (x // s, x % s)
	if d >= 1 and r <= 1:
		flag = True
print('YES' if flag else 'NO')


(a, b, c) = map(int, input().rstrip().split(' '))
i = 1
bark_list = [a]
bark = a
if a == 0 and c == b:
	print('YES')
elif c < b and c == a:
	print('YES')
elif c > b and c > a:
	if (c - a) % b == 0 or ((c - a) % b == 1 and c - a > 2):
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def pine_apple():
	time = input().split()
	time = [int(i) for i in time]
	if time[0] == time[2]:
		print('YES')
	elif time[0] > time[2]:
		print('NO')
	else:
		integer = 0
		s = int(time[2] / time[1])
		while time[0] + s * time[1] > time[2]:
			s -= 1
		if s == 0:
			s = 1
		while True:
			temp = time[0] + s * time[1] + integer
			if temp == time[2]:
				print('YES')
				return
			elif temp > time[2]:
				print('NO')
				return
			elif integer == 0:
				integer += 1
			elif integer == 1:
				integer = 0
				s += 1
pine_apple()


import sys

def main():
	(t, s, x) = stdin_get_ints_from_line()
	if t == x:
		return 'YES'
	if t + s > x:
		return 'NO'
	if (x - t) % s == 0 or (x - t - 1) % s == 0:
		return 'YES'
	return 'NO'

def stdin_get_ints_from_line():
	return (int(x) for x in sys.stdin.readline().strip().split(' '))

def stdin_get_ints_list_from_line():
	return list((int(x) for x in sys.stdin.readline().strip().split(' ')))

def stdin_get_string_from_line():
	return sys.stdin.readline().strip()
print(main())


def pineapple(t, s, x):
	first = t
	if t == x:
		return 'YES'
	else:
		while first <= x:
			first += s
			second = first + 1
			if first == x or second == x:
				return 'YES'
		else:
			return 'NO'

def pineapple2(t, s, x):
	a = (x - t) // s
	if a > 0:
		b = a * s + t
		b1 = b + 1
		if b == x or b1 == x:
			return 'YES'
		else:
			return 'NO'
	elif t == x:
		return 'YES'
	else:
		return 'NO'
lis = list(map(int, input().split()))
t = lis[0]
s = lis[1]
x = lis[2]
print(pineapple2(t, s, x))


def bark(t, s, x):
	if x == t:
		return 'YES'
	if x > t + 1:
		if (x - t) % s == 0 or (x - t - 1) % s == 0:
			return 'YES'
	return 'NO'
(t, s, x) = list(map(int, input().split()))
print(bark(t, s, x))


(t, s, x) = map(int, input().split())

def pineapple_incident(t, s, x):
	if x == t:
		return 'YES'
	elif x < t + s:
		return 'NO'
	else:
		k = (x - t) % s
		if k <= 1:
			return 'YES'
		else:
			return 'NO'
print(pineapple_incident(t, s, x))


(t, s, x) = [int(x) for x in input().split()]
if t + s <= x:
	x = (x - t) % s
	print(['NO', 'YES'][x == 0 or x == 1])
else:
	print(['NO', 'YES'][x == t])


(n, m, x) = map(int, input().split())
if x < n or x - 1 == n or (x != n and (x - n) % m != 0 and ((x - n - 1) % m != 0)):
	print('NO')
else:
	print('YES')


A = input().split()
for i in range(len(A)):
	A[i] = int(A[i])
if ((A[2] - A[0]) % A[1] == 0 or ((A[2] - A[0] - 1) % A[1] == 0 and A[2] != A[0] + 1)) and A[2] >= A[0]:
	print('YES')
else:
	print('NO')


(t, s, x) = map(int, input().split())
e = x - t
v = e % s
if x >= t + s and (v == 0 or v == 1) or x == t:
	print('YES')
else:
	print('NO')


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


def isPineappleIncident(t, s, x):
	return 'YES' if x >= t and (x == t or (x - t) % s == 0 or ((x - t - 1) % s == 0 and x - t - 1 != 0)) else 'NO'
(t, s, x) = map(int, input().split())
print(isPineappleIncident(t, s, x))


(t, s, x) = list(map(int, input().split()))
if t == x:
	print('Yes')
elif x < t:
	print('No')
elif (x - t) % s == 0:
	print('Yes')
else:
	tam = (x - t) // s
	if tam == 0:
		print('No')
	elif t + s * tam + 1 == x:
		print('Yes')
	else:
		print('No')


def main():
	given = input()
	y = given.split(' ')
	for i in range(3):
		y[i] = int(y[i])
	(t, s, x) = y
	if t == 0 and x % s == 0:
		print('YES')
		return
	t_time = 0
	count = 0
	flag = 0
	while True:
		while count < 1:
			t_time = t
			if t_time > x:
				print('NO')
				flag = 1
				break
			if t_time == x:
				print('YES')
				flag = 1
				break
			count = 1
		if flag == 1:
			break
		t_time = t + count * s
		if t_time > x:
			print('NO')
			break
		if t_time == x:
			print('YES')
			break
		t_time = t + count * s + 1
		if t_time > x:
			print('NO')
			break
		if t_time == x:
			print('YES')
			break
		count += 1
main()


(t, s, x) = map(int, input().split())
if x < t or x == t + 1:
	check = False
elif x == t:
	check = True
elif (x - t) % s == 0 or (x - t - 1) % s == 0:
	check = True
else:
	check = False
print(['NO', 'YES'][check])