天天看點

【Codeforces Round 362 (Div 2)A】【簡單讨論】Pineapple Incident

A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output

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.

【Codeforces Round 362 (Div 2)A】【簡單讨論】Pineapple Incident

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 ≤ 109,2 ≤ s ≤ 109) — 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.

#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<ctype.h>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<bitset>
#include<algorithm>
#include<time.h>
using namespace std;
void fre() { freopen("c://test//input.in", "r", stdin); freopen("c://test//output.out", "w", stdout); }
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x,y) memcpy(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define ls o<<1
#define rs o<<1|1
typedef long long LL;
typedef unsigned long long UL;
typedef unsigned int UI;
template <class T1, class T2>inline void gmax(T1 &a, T2 b) { if (b>a)a = b; }
template <class T1, class T2>inline void gmin(T1 &a, T2 b) { if (b<a)a = b; }
const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int t, s, x;
bool check()
{
	if (x < t)return 0;
	if (x == t)return 1;
	if (x == t + 1)return 0; 
	return ((x - t) % s == 0 || (x - t) % s == 1);
}
int main()
{
	while (~scanf("%d%d%d", &t, &s, &x))
	{
		puts(check() ? "YES" : "NO");
		
	}
	return 0;
}