/**
 * Created by lukask on 9/24/17.
 */
function isPalindrome(number) {
  var i = 0;
  for (i = 0; i < number.length / 2; i++) {
    // print(number[i] + ' === ' + number[number.length - i - 1]);
    if (number[i] !== number[number.length - i - 1]) {
      return false;
    }
  }
  return true;
}

function isQuasiPalindrome(number) {
  if (isPalindrome(number)) {
    return 'YES';
  }
  var zeroesInFront = 0;
  var zeroesInBack = 0;
  var i = 0;
  while (number[i] === '0') {
    i++;
  }
  zeroesInFront = i;
  i = number.length - 1;
  while (number[i] === '0') {
    i--;
  }
  zeroesInBack = number.length - i - 1;
  if (zeroesInFront > zeroesInBack) {
    // print(zeroesInFront + '  ' + zeroesInBack);
    return 'NO';
  }
  number = number.substring(0, number.length - (zeroesInBack - zeroesInFront));
  // print(number);
  if (isPalindrome(number)) {
    return 'YES'
  }
  // print(zeroesInBack);
  return 'NO';
}

print(isQuasiPalindrome(readline()));

function pal(s,l,r)
{
    if (r-l<=0)
    {
        return 1;
    }
    return s[l]==s[r]&&pal(s,l+1,r-1);
}

s=readline()
var fl="NO";
for (var i=0;i<=11;i++)
{
    if (pal(s,0,s.length-1))
    {
        fl="YES"
        break;
    }
    s='0'+s
}
print(fl)

var line = readline();

function isQuasi(input) {
    var end = input.length - 1;
    while (end >= 0 && input[end] === '0') {
        end--;
    }

    var start = 0;
    while (start < end) {
        if (input[start] !== input[end]) {
            return 'NO';
        }

        start++;
        end--;
    }

    return 'YES';
}

print(isQuasi(line));

//var input = readline()

var str = readline().split(' ');
var s = str[0];

// Last char zero delete
var x = s.replace(/0*$/g, '');

// Palindrome check function
function check(str) {
    var s = str.replace(/[^A-Za-z0-9]/g, '').split('').reverse().join('')
    return s == str
}

print(check(x) ? 'YES' : 'NO');

//

var s = readline();

var a = s.replace(/0*$/g, '');
var b = a.replace(/[^A-Za-z0-9]/g, '').split('').reverse().join('');

print(a == b ? 'YES' : 'NO');

var s = readline();

var a = s.replace(/0*$/g, '');
var b = a.split('').reverse().join('');

print(a == b ? 'YES' : 'NO');

//var input = readline()
var str = readline().split(' ');
var s = str[0];

var a = s.replace(/0*$/g, ''); // last char zero delete
var b = a.replace(/[^A-Za-z0-9]/g, '').split('').reverse().join(''); // palindrome check

print(a == b ? 'YES' : 'NO');

//

function trimZeros(num){

    if(!(typeof num == 'number'))
    num = parseInt(num);

    //make a string of the number
    num = num + "";

    //trim leading zeros
    num = parseInt(num);
    num = num + "";

    //trim the last zeros
    num = num.split("").reverse().join("");
    num = parseInt(num);

    return num;
}

function odd(num){
    return ( +num % 2 == 1);
}

function even(num){
    return (!odd(num));
}

function quasiPalindromic(num){

    num = trimZeros(num);
    num = num + "";

    var searchScope;
    if(odd(num)) searchScope = (num.length - 1) / 2;
    else         searchScope =  num.length / 2;

    for(var i = 0; i < searchScope; i++){
        if(!(num[i] == num[num.length-i-1]))
            return "NO";
    }

    return "YES"
}

var inputData = readline();

print(quasiPalindromic(+inputData));

let data = '';
process.stdin.on('data', c => data += c);
const sol = () => {
	let x = Number(data);
	while(x%10 === 0) x /= 10;
	let a = x, b = 0;
	while(x > 0){
		b *= 10;
		b += x%10;
		x = Math.trunc(x/10);
	}
	console.log(a === b?'YES':'NO');
};
process.stdin.on('end', sol);

var line = readline();

function isQuasi(input) {
    var end = input.length - 1;
    while (end >= 0 && input[end] === '0') {
        end--;
    }

    var start = 0;
    while (start < end) {
        if (input[start] !== input[end]) {
            return false;
        }

        start++;
        end--;
    }

    return true;
}

print(isQuasi(line));


var
	r = readline().split(' '),
	a = +r[0],
	b = +r[1],
	result = a
;
while(a >= b){
	var new_value = Math.floor(a / b);
	result += new_value;
	a = a % b + new_value;
}
print(result);

var r = readline().split(' ');
var a = +r[0];
var b = +r[1];
var result = a;
while(a >= b){
	result += Math.floor(a / b);
	a = a % b + Math.floor(a / b);
}
print(result);

function f(a,b,c){
    if (a==0){ return 0; }
    else { return a + f(Math.floor((a+c)/b), b, (a+c)%b); }
}
a = readline().split(' ').map(Number);
print(f(a[0], a[1], 0));

var params = readline().split(" ").map(value => +value);
var a = params[0], b = params[1];
var hours = a, period = b, temp;

while(a >= 1) {
	temp = (a - a % b) / b;
	hours += temp;
	a = temp + (temp > 0) * (a % b);
}

print(hours);

function main() {
    var line = readline().split(' ')
    var a = parseInt(line[0])
    var b = parseInt(line[1])

    var res = solve(a, 0, b, 0)
    print(res);
}

function solve(newc, usedc, b, res) {
    // print(newc, usedc, b, res)
    res += newc
    usedc += newc;
    newc = Math.floor(usedc / b)
    usedc %= b;

    if (newc == 0) {
        return res;
    } else {
        return solve(newc, usedc, b, res);
    }
}

main()

var
    line = readline().split(" "),
    num  = parseInt(line[0]),
    brok = parseInt(line[1])
    h    = num
;

while(num >= brok) {

    var newSt = parseInt(num / brok);
    h += newSt;
    num = newSt + num % brok;

}

print(h);

var line = readline().split(' ').map(Number);

var a = line[0];
var b = line[1];

var leftover = a;

var hours = a;

while(Math.floor(leftover/b)>0){

    hours += Math.floor(leftover/b);
    var temp = leftover%b;
    leftover = Math.floor(leftover/b);
    leftover+=temp;
}

print(hours);

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + ~~(a/b);
}

print (ans + a)

var
	r = readline().split(' '),
	a = +r[0],
	b = +r[1],
	result = a
;
while(a >= b){
	result += parseInt(a / b);
	a = a % b + parseInt(a / b);
}
print(result);

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + Math.floor(a/b);
}

print (ans + a)

var data = readline().split(' ').map(function (e) { return parseInt(e) })
a = data[0]
b = data[1]

r = a
burnedCandle = a

while (burnedCandle >= b) {
    newBurndeCandle = Math.trunc(burnedCandle / b)
    r += newBurndeCandle
    burnedCandle -= newBurndeCandle * b
    burnedCandle += newBurndeCandle
}

print(r)

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + (a/b)>>0;
}

print (ans + a)

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var cnt = 0, ans = 0

while (a)
{
 a--;
 cnt++;
 ans++;
 if (cnt == b)
 {
  cnt = 0
  a++;
 }
}

print (ans)

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);

var res=0;
var rest =0;

	while (a>=1){

	res+= a;
	rest += ( a - Math.floor(a/b)*b);

		a = Math.floor(a/b);

		if (rest>=b) {
		a+=Math.floor(rest/b);
		rest-=b;
		}

	}

print(res);

;(function () {

	var s = readline().split(' ');
	var a = +s[0], b = +s[1], d = 0, t = 0;

	do {
		t += a;
		d += a;
		a = Math.floor(d / b);
		d -= a * b;
	} while ( (d+a) >= b )

	t += a;

	print(t);

}).call(this);

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + (a-a%b)/b;
}

print (ans + a)

var s = readline().split(" ");
var a = Number(s[0]), b = Number(s[1]);

var hours = 0;
var left = 0;
while(a!==0) {
    hours++;
    left++;
    a--;
    if (left === b) {
        a++;
        left = 0;
    }
}
print(hours);

r= readline().split(' ');
a=Number(r[0])
print(a+(a-1)/(Number(r[1])-1)>>0);

'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let temp = readline().getNumArray(),
    a = temp[0],
    b = temp[1],
    usedA = 0,
    hours = 0;

while(a) {
  a--;
  usedA++;
  hours++;
  if(usedA === b) {
    usedA = 0;
    a++;
  }
};

write(hours);

var r= readline().split(' ');
	var a=Number(r[0]);
	var b=Number(r[1]);

	var hours=0;
	hours = a+(Math.floor((a-1)/(b-1)));
	print(hours);

r= readline().split(' ');
a=Number(r[0])
print(a+(Math.floor((a-1)/(Number(r[1])-1))));

var r= readline().split(" ");
	var a=Number(r[0]) ,  b=Number(r[1]);

	var hours=0;
	hours = a+Math.floor((a-1)/(b-1));
	print(hours);

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);
var h = a;
var extra = Math.floor(a/b);
var burned = extra;
var rest = a%b;
while(extra>=1){
h=h+burned;
extra = Math.floor((burned+rest)/b);
rest = (burned+rest)%b;
burned = extra;
}

print(h);

var candils= readline().split(' ');
	var a=Number(candils[0]);
	var b=Number(candils[1]);

	var hours=0;
	hours = a+(Math.floor((a-1)/(b-1)));
    print(hours);
    // console.log(hours);

        function main(){
            var s = readline().split(' ');
            var a = parseInt(s[0]);
            var b = parseInt(s[1]);

            var answer = a;
            while(parseInt(a/b) > 0){
                answer += parseInt(a / b);
                a = parseInt(a/b) + a % b;
            }
            print(answer);
        }
        main();

const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let [a, b] = input[0].split(' ').map(x => parseInt(x));
  let answ = a;

  let ost = a;
  while (ost >= b) {
    answ += parseInt(ost/b);
    ost = parseInt(ost/b) + (ost % b);
  }

  console.log(answ);
});

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function main() {
	let [a, b] = readLine()
		.split(' ')
		.map(x => parseInt(x));
	let s = a;
	let hours = 0;

	while (Math.floor(a / b) > 0) {
		hours += Math.floor(a / b);
		a = Math.floor(a / b) + (a % b);
	}

	console.log(Math.round(s + hours));
}

var input = readline().split(" "), a = +input[0], b = +input[1], hours = 0, rest = 0;

for(i = 0; a > 0 ;i++){
	hours += a;
	rest += a%b;
	a = Math.floor(a/b) + Math.floor(rest/b);
	if(rest/b >= 1){
		rest -= Math.floor(rest/b)*b;
	}
}
write(hours);

var solve = function(n,m) {
  var res = 0;
  var b = 0;
  while (n > 0) {res ++; n--; b++; if (b == m) {n++; b = 0;}}
  return res;
}

var str = readline().split(' ');
var n = +str[0];
var m = +str[1];
print(solve(n,m));

var str = readline().split(" ");
var n = +str[0];
var m = +str[1];
var res=n;
var r = 0;
while (n>=1) {
    if(n%m==0){
	  n=(n/m);
	  res+=+n;
	  n=n+r;
	  r=0;
    }
	else {
	n--;
	r++;
	}

}
print(res);

var p = readline().split(" ");
var c = parseInt(p[0]);
var s = parseInt(p[1]);
var t;
var w = 0;
var h = 0;

while (c>0) {
	h += c;
	w += c;
	c = ~~(w/s);
	w = w%s;
}

print(h);

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);

var toRepair = a;
var hours = a;
var leftovers = 0;

while (toRepair >= b) {
  // write(toRepair);

  var repaired = Math.floor(toRepair / b);

  leftovers = toRepair % b;
  hours += repaired;
  toRepair = repaired + leftovers;

  // write(" " + repaired + "\n");
}

print(hours);

/* TEST CASE
Examples
input
4 2
output
7

input
6 3
output
8
*/
function main() {
	var splitted = readline().split(' ');
	var a = parseInt(splitted[0]);
	var b = parseInt(splitted[1]);

	var answer = a;

	if (a >= b) {
		answer += 1 + Math.floor((a - b)/(b - 1));
	}
	print(answer);
}

main();

var l = readline().split(' ')
var a = +l[0], b = +l[1], z = a
for (; a >= b; ) {
	z += Math.floor(a / b)
	a = a % b + Math.floor(a / b)
}
print(z)

var ab = readline().split(' ');
var a = parseInt(ab[0]);
var b = parseInt(ab[1]);

var ret = 0;

while(a >= b){
	ret += b;
	a = a-b+1;
}

ret += a;

print(ret);

var s = readline().split(' ');
var n = Number(s[0]), m = Number(s[1]);

var hours = 0;
hours = n + Math.floor((n-1)/(m-1));

print(hours);

var line = readline();
var arr = line.split(" ");
var sum = parseInt(arr[0]);
var rest = "0";

while(arr[0]>0) {
    arr[0] = +arr[0] + +rest;
    rest = Math.floor(arr[0]%arr[1]);
    arr[0] = Math.floor(arr[0]/arr[1]);
    sum = +sum + +arr[0];
}

print(sum)

var token = readline().split(' ');

var a = token[0], b = token[1];
var wasted = 0;
var ans = 0;

while(a>0) {
  ++wasted;
  --a;

  ++ans;

  if(wasted==b) {
    wasted=0;
    ++a;
  }
}

print(ans);

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b = ar[1];
var sum = a;
while(a >= b) {
  var div = Math.floor(a / b);
  var mod = a % b;
  a = mod + div;
  sum += div;
}
print (sum);

var str = readline().split(" ");
var n = str[0];
var m = str[1];
var res=0;
while (n>=1) {
   res+=+n;
   n=n/m;
}
print(Math.round(res));

var str = readline().split(" ");
var n = str[0];
var m = str[1];
var res=0;
while (n>=1) {
   res+=+n;
   n=n/m;
}
print(res);

var str = readline().split(" ");
var n = str[0];
var m = str[1];
var res=0;
while (n>=1) {
   res+=+n;
   n=n/m;
}
print(Math.ceil(res));

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);

var toRepair = a;
var hours = a;
var leftovers = 0;

while (toRepair >= b) {
  // write(toRepair);
  toRepair = toRepair + leftovers;

  var repaired = Math.floor(toRepair / b);
  leftovers = toRepair % b;

  hours += repaired;
  toRepair = repaired;

  // write(" " + repaired + "\n");
}

print(hours);

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);

var toRepair = a;
var hours = a;

// print(6 / 3 / 3);

while (toRepair >= b) {
  var repaired = Math.floor(toRepair / b);

  hours += repaired;
  toRepair = repaired;

  // print(toRepair, repaired);
}

print(hours);

var l = readline().split(' ')
var a = +l[0], b = +l[1], z = 0
for (; a; a = Math.floor(a / b)) {
	z += a
}
print(z)

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], h = a;
while (true){
  a /= b;
  h+=Math.floor(a);
  if (a < 1) break;
}
print (h);

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], h = 0;
while (true){
  h+= a;
  a = a / b;
  if (a < 0.0000000000001) { h += a; break };
}
print (Math.floor(h));

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], h = a;
while (true){
  a /= b;
  h+=Math.floor(a);
  if (a < b) break;
}
print (h);

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], rem = 0, h = a;
while (true){
  h+=Math.floor(a / b);
  a = Math.floor(a / b)  + a % b;
  if (a < b) { h += a; break };
}
print (h);

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], h = 0;
while (true){
  h+= Math.floor(a);
  a = Math.floor(a / b);
  if (a < b) { h += Math.floor(a); break };
}
print (h);

var ar = readline().split(" ").map(function(x) { return parseInt(x); });
var a = ar[0], b=ar[1], h = 0;
while (true){
  h+= Math.floor(a);
  a =a / b;
  if (a < b) { h += Math.floor(a); break };
}
print (h);

function f(a,b,c){
    if (a==0){ return 0; }
    else { return a + f(Math.floor((a+c)/b), b, a%b); }
}
a = readline().split(' ').map(Number);
print(f(a[0], a[1], 0));

print(function f(a,b){
    if (a==0){ return 0;
    } else { return a + f(Math.floor(a/b), b);}
}.apply(0,readline().split(' ').map(Number)));

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + ~~a/b;
}

print (ans + a)

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var cnt = 0, ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + a/b;
}

print (ans + a)

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += (a / b) * b;
 a = a%b + a/b;
}

print (ans + a)

var l = readline().split (" ");

var a = parseInt(l[0])
var b = parseInt(l[1])
var ans = 0

while (a >= b)
{
 ans += a - a%b;
 a = a%b + a/b;
}

print (ans + a)

var a=readline();
var b=readline();
var sum = a;
while(a>=b){
   sum += parseInt(a / b);
	a = a % b + parseInt(a / b);
}
print(sum);

r= readline().split(' ');
a=Number(r[0])
print(a+(a-1)/(Number(r[1])-1));

function main(){
   var s = readline().split();

   var a = parseInt(s[0]);
   var b = parseInt(s[1]);

   var answer = a;
   while(a/b > 0){
       answer += a / b;
       a /= b;
   }
   print(answer);
}
main();

function main(){
   var s = readline().split();

   var a = parseInt(s[0]);
   var b = parseInt(s[1]);

   var answer = a;
   while(parseInt(a/b) > 0){
       answer += parseInt(a / b);
       a = bparseInt(a/b);
   }
   print(answer);
}
main();

function main(){
   var s = readline().split();

   var a = parseInt(s[0]);
   var b = parseInt(s[1]);

   var answer = a;
   while(parseInt(a/b) > 0){
       answer += parseInt(a / b);
       a = parseInt(a/b);
   }
   print(answer);
}
main();

function main(){
   var s = readline().split(' ');

   var a = parseInt(s[0]);
   var b = parseInt(s[1]);

   var answer = a;
   while(parseInt(a/b) > 0){
       answer += parseInt(a / b);
       a = parseInt(a/b);
   }
   print(answer);
}
main();

const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let [a, b] = input[0].split(' ').map(x => parseInt(x));
  let answ = a;

  let ost = a;
  while (ost > 0) {
    answ += parseInt(ost/b);
    ost = parseInt(ost/b);
  }

  console.log(answ);
});

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function main() {
	let [a, b] = readLine()
		.split(' ')
		.map(x => parseInt(x));
	let s = a;
	let hours = 0;

	while (Math.floor(a / b) !== 0) {
		hours += Math.floor(a / b);
		a = Math.floor(a / b);
	}

	console.log(s + hours);
}

var line = readline().split(' ');
var a = parseInt( line[0] );
var b = parseInt( line[1] );

var ret = b; 2
while( (a = a-b+1) >= b){
	ret += b;
}
ret += a;
print(ret);

var line = readline().split(' ');
var a = parseInt( line[0] );
var b = parseInt( line[1] );

var ret = b;
while( (a = a-b+1) >= b){
	ret += b;
}
ret += a;
print(ret);

var line = readline().split(' ');
var a = parseInt( line[0] );
var b = parseInt( line[1] );

var ret = a;

a = a - b + 1;
while( (a = a-b+1) > 0){

	ret += a;
}
print(ret);

var line = readline().split(' ');
var a = parseInt( line[0] );
var b = parseInt( line[1] );

var ret = a;

while( a=~~(a/b) ){
	ret += a;
}
print(ret);

var line = readline().split(' ');
var a = parseInt( line[0] );
var b = parseInt( line[1] );

var ret = a-b;
while( (a = a-b+1) > 0){

	ret += a;
}
print(ret);

var input = readline().split(" "), a = +input[0], b = +input[1], hours = 0, rest = 0;

for(i = 0; a > 0 ;i++){
	hours += a;
	rest += (a/b > 1) ? a%b : 0;
	a = Math.floor(a/b) + Math.floor(rest/b);
	if(rest/b >= 1){
		rest -= Math.floor(rest/b)*b;
	}
}
write(hours);

var line = readline();
var arr = line.split(" ");
var sum = 0;

while(arr[0]>0) {
    sum+=parseInt(arr[0]);
    arr[0] = Math.floor(arr[0]/arr[1])
}

print(sum)

var token = readline().split(' ');

var a = token[0], b = token[1];
var ans = 0, curr = 1;

while(curr<=a) {
  ans+=((a/curr)>>0);
  curr*=b;
}

print(ans);

var r = readline().split(' ');
var a = +r[0];
var b = +r[1];

var result = 0;
	if(b % 2 == 0 && a !== b){
		result = (a + b) + 1;
	}else if(b % 2 == 0 && a === b){
		result = a + 1;
	}else if(b % 2 !== 0 && a !== b){
		result = (a + b) - 1
	}else if(b % 2 !== 0 && a === b){
		result = a - 1;
	}

print(result);

var r = readline();
var a = +r[0];
var b = +r[1];

if(b % 2 == 0){
	var result = a + a/b + 1;
}else {
	var result = a + a/b;
}
print(result);

var r = readline().split(' ');
var a = +r[0];
var b = +r[1];
var z = a;
for(;a >= b; ){
	z += Math.floor(a / b);
	a = Math.floor(a / b);
}
print(z);

var r = readline();
var a = +r[0];
var b = +r[1];

var result = 0;
if(b % 2 == 0){
	result = a + a/b + 1;
}else {
	result = a + a/b;
}
print(result);

var r = readline();
var a = +r[0];
var b = +r[1];

var result = 0;
	if(b % 2 !== 0){
		result = a + b + 1;
	}else {
		result = a + b - 1;
	}
print(result);

var r = readline();
var a = +r[0];
var b = +r[1];
var result = 0;
var i = 0;

// while(a -= 2){
// 	result += a;
// 	i++;
// }

var result = 0;
if(b % 2 == 0){
	result = a + (a/b) + 1;
}else {
	result = a + (a/b);
}
print(result);

var r = readline();
var a = +r[0];
var b = +r[1];
var result = 0;
var i = 0;

// while(a -= 2){
// 	result += a;
// 	i++;
// }

var result = 0;
if(b % 2 == 0){
	result += (a + (a/b) + 1);
}else {
	result += (a + (a/b));
}
print(result);

var r = readline().split(' ');
var a = +r[0];
var b = +r[1];

var result = 0;
	if(b % 2 == 0){
		result = (a + b) + 1;
	}else {
		result = (a + b) - 1;
	}
print(result);

var r = readline();
var a = +r[0];
var b = +r[1];

var result = 0;
	if(b % 2 == 0){
		result = a + b + 1;
	}else {
		result = a + b - 1;
	}
print(result);

var r = readline().split(' ');
var a = +r[0];
var b = +r[1];

var result = 0;
	if(b % 2 == 0){
		result = (a + (a/b)) + 1;
	}else {
		result = (a + (a/b)) - 1;
	}
print(result);

var data = readline().split(' ').map(function (e) { return parseInt(e) })
a = data[0]
b = data[1]

r = a
burnCandle = a

while (burnCandle >= b) {
    r += Math.trunc(burnCandle / b)
    burnCandle = Math.trunc(burnCandle / b)
}

print(r)

var line = readline().split(' ');
var a = parseInt(line[0]);
var b = parseInt(line[1]);

var res=0;

while (a>=1){

res+= a;

a = Math.floor(a/b);

}

print(res);

var s = readline().split(" ");
var a = Number(s[0]), b = Number(s[1]);

var hours = 0;
var left = 0;
while(a!==0) {
    hours++;
    left++;
    a--;
    if (left === b) {
        a++;
    }
}
print(hours);

var r= readline().split('');
	var a=Number(r[0]);
	var b=Number(r[1]);

	var hours=0;
	hours = a+Math.floor((a-1)/(b-1));
	print(hours);

var r= readline().split("'");
	var a=Number(r[0]) ,  b=Number(r[1]);

	var hours=0;
	hours = a+Math.floor((a-1)/(b-1));
	print(hours);

var r= readline().split('');
	var a=Number(r[0]);
	var b=Number(r[1]);

	var hours=0;
	hours = a+(Math.floor((a-1)/(b-1)));
	print(hours);

var r= readline().split('');
	var a=Number(r[1]);
	var b=Number(r[2]);

	var hours=0;
	hours = a+Math.floor((a-1)/(b-1));
	print(hours);

var r= readline().split("");
	var a=Number(r[0]) ,  b=Number(r[1]);

	var hours=0;
	hours = a+Math.floor((a-1)/(b-1));
	print(hours);


var input = readline();
var n = input;
var val = [0];
while (true) {
  val[0] = (val[0] + 1) % 10;
  if (val[0] === 0) {
    val.push(0);
    val[0] = 1;
  }
  if (+(val.join('')) > +n) {
    print(+(val.join('')) - +n);
    break;
  }
}

  var n = parseInt(readline());
  var s = n.toString().split('');

  if(s[0] === '9') {
    print(parseInt('1' + new Array(s.length).fill(0).join('')) - n);
  } else {
    print(parseInt((parseInt(s[0]) + 1).toString() + new Array(s.length - 1).fill(0).join('')) - n);
  }

var a =parseInt(readline());
var sol=2000000000;
function min(a,b){
  if(a<b)return a;
  return b;
}
function recurse(cur){
  if(cur>a){
    sol=min(sol,cur);
    return;
  }
  if(cur==0){
    for (var i = 1; i <= 9; i++) {
     recurse(i);
    }
  }
  else
   recurse(cur*10);
}
recurse(0);
print(sol-a);

var data = readline();
var a = String(data);
var b;
var c = '';
var d;

if(a.length == 1) {
  d = parseInt(a) + 1;
  d = d-parseInt(a)
  print(d);

} else {
  b = parseInt(a[0])+1;
  for(var i = 1; i< a.length; i++) {
     c += '0';
  }

  b = parseInt(String(b)+c);

  print(b-parseInt(a));
}

var a = parseInt(readline());
var t = 1;
var b = 0;
for (var i = 1; i <= 10; i ++)
{
	if (a/Math.pow(10, i) < 1)
	{
		t = Math.pow(10, i-1);
		b = parseInt(a/t) * t;
		break;
	}
}
print(t+b-a);

var a =parseInt(readline());
var sol=200000000;
function min(a,b){
  if(a<b)return a;
  return b;
}
function recurse(cur){
  if(cur>a){
    sol=min(sol,cur);
    return;
  }
  if(cur==0){
    for (var i = 1; i <= 9; i++) {
     recurse(i);
    }
  }
  else
   recurse(cur*10);
}
recurse(0);
print(sol-a);

var input = readline();

var n = input;

if (n.indexOf('0') != -1) {
  var m = n.split('');
  for (var i = m.indexOf('0') + 1; i < m.length; i++) {
    if (m[i] === '0') {
      m[i] = '1';
    }
  }
  print(+(m.join('')) - +n);
} else {
  print(10 - (+n[n.length - 1]));
}

var data = readline();
var a = String(data);
var b,c='';

if(a.length == 1) {
  a = parseInt(a) + 1;
  print(a)
} else {
  b = parseInt(a[0])+1;
  for(var i = 1; i< a.length; i++) {
     c += '0';
  }

  b = parseInt(String(b)+c);

  print(b-parseInt(a));
}

var data = readline();
var a = String(data);
var b;
var c = '';
var d;

if(a.length == 1) {
  d = parseInt(a) + 1;
  d = d-parseInt(a)
  print(d);

} else {
  b = parseInt(a[0])+1;
  for(var i = 1; i< a.length; i++) {
     c += '0';
  }

  b = parseInt(String(b)+c);

  print(typeof b-parseInt(a));
}

var data = readline();
var a = String(data);
var b;
var c = '';

if(a.length == 1) {
  a = parseInt(a) + 1;
  print(a);

} else {

  b = parseInt(a[0])+1;
  for(var i = 1; i< a.length; i++) {
     c += '0';
  }

  b = parseInt(String(b)+c);

  print(b-parseInt(a));
}


const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})

function main() {
    comparison(stdin[0],stdin[1])
}

var stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);
/*
const main = async () => {
  await question1()
  rl.close()
}

main()
*/

function comparison(n, m) {
  var firstStr = String(n);
  if(String(n).length == 1 || String(m).length == 1){
      return n == m ? console.log("OK") : console.log("WRONG_ANSWER")
  }
  var result = '';
  var count = 0
  while( firstStr ) {
    var min = 999;
    for(var i = 0; i < firstStr.length; i++) {
      if(Number(firstStr[i] < min)) {
      	if(count == 0 && Number(firstStr[i]) == 0){
        } else {
        	min = firstStr[i]
        }
      }
  	}
    var index = firstStr.indexOf(min);
    result += firstStr.slice(index, index+1)
    firstStr = firstStr.slice(0, index) + firstStr.slice(index+1, firstStr.length)
    count ++
  }
  if(result == m) {
  	console.log("OK")
  } else {
  	console.log("WRONG_ANSWER")
  }
}

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var s = trim(readline()), guess = trim(readline());
	if (s == '0') {
		print(guess == '0' ? "OK" : "WRONG_ANSWER");
		return;
	}

	var digits = [];
	for (var i = 0; i < s.length; i += 1) {
		digits.push(s[i]);
	}
	digits.sort();

	if (digits[0] == '0') {
		for (var i = 1; i < digits.length; i += 1) {
			if (digits[i] != '0') {
				digits[0] = digits[i];
				digits[i] = '0';
				break;
			}
		}
	}

	var correct = digits.join('');
	print(guess == correct ? "OK" : "WRONG_ANSWER");
}

main();

var N = readline()
var M = readline()

var n = N.split('').sort()

var i = 0
while (n[i++] == '0') {}
i--

if (i) {
	n[0] = n[i]
	n[i] = '0'
}

n = n.join('')

print(M == n ? 'OK' : 'WRONG_ANSWER')

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})

const question1 = () => {
  return new Promise((resolve, reject) => {
    rl.question("", answer );//=>
    rl.question("", answer2 );

  	console.log("answer");
  	console.log(answer);
    {
      comparison(answer, answer2)
      resolve()
    }
  })
}

const main = async () => {
  await question1()
  rl.close()
}

main()

function comparison(n, m) {
  var firstStr = String(n);
  if(String(n).length == 1 || String(m).length == 1){
      return n == m ? console.log("OK") : console.log("WRONG_ANSWER")
  }
  var result = '';
  var count = 0
  while( firstStr ) {
    var min = 999;
    for(var i = 0; i < firstStr.length; i++) {
      if(Number(firstStr[i] < min)) {
      	if(count == 0 && Number(firstStr[i]) == 0){
        } else {
        	min = firstStr[i]
        }
      }
  	}
    var index = firstStr.indexOf(min);
    result += firstStr.slice(index, index+1)
    firstStr = firstStr.slice(0, index) + firstStr.slice(index+1, firstStr.length)
    count ++
  }
  	console.log(result);
  	console.log(m);
  if(result == m) {
  	console.log("OK")
  } else {
  	console.log("WRONG_ANSWER")
  }
}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  if(N % 4 == 2 || N % 4 == 1){
    myout(1);
  }else{
    myout(0);
  }
}

var n =parseInt(readline());
print(Math.ceil(n/2)%2);

function main() {
    var n = +readline();
    if(n === 1 || n === 2)
        return 1;
    if(n === 3 || n === 0 || n%4 === 0)
        return 0;
    if(n%2 === 0)
        return 1;

    var a = Math.floor((n + 1) / 4);
    if(a * 4 - 1 === n)
        return 0;
    return 1
}

print(main());

function main(n){

    var ans = [0,1,1,0];
    var printe = 0;
    if(n>=4)printe = ans[n%4];
    else  printe = ans[n]
    print(printe);
}

var n = parseInt(readline());

main(n);

var a = readline().split(' ');
print(Math.ceil(a/2)%2)

var n = readline().split(' ');
print(Math.ceil(n/2)%2)

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const [n] = [d].map(BigInt);
  const total = n * (n + 1n) / 2n;

  console.log((total % 2n).toString());
});

function calc(n) {
  if (n === 0 || n % 4 === 0 || n % 4 === 3) {
    return 0
  } else {
    return 1
  }
}

var n = parseInt(readline());

print(calc(n));

var number = parseInt(readline());
var result = number % 4;
print(result === 1 || result ===2 ? 1 : 0);

var n = readline();
n = parseInt(n);

if (n%4 == 0 || n%4 == 3) print (0)
	else print (1);

 var n = readline();
    print( ((1 + n) * n / 2) % 2 );

var n = readline();
var s = (1 + n) * n / 2;
print( s % 2 === 0 ? 'YES' : 'NO');

function main() {
    var n = +readline();
    if(n === 1 || n === 2)
        return 1;
    if(n === 3 || n === 0 || n%4 ===0)
        return 0;
    if(n%2 === 0)
        return 1;

    var a = Math.floor((n + 1) / 4);
    if(a * 4 + 1 === n)
        return 0;
    return 1
}

print(main());

function main(n){

    var ans = [0,1,1,0];
    var printe = 0;
    if(n>=4)printe = ans[n%4];
    else if (ans < 4) printe = ans[n]
    print(printe);
}

var n = parseInt(readline());

main(n);

var a = readline().split(' ');
print(a);
var sum = 0;
for(var i=1; i<=a; i++) {
    sum+=i;
}

print(sum%2)

var n = readline().split(' ');
var ans = (n*(1+n))/2;
print(ans%2);


var w = readline();

w>2 && w % 2 === 0? print('YES') : print('NO');

const state = { stdin: Buffer.alloc(0) };
const consume = (chunk) =>
  (state.stdin = Buffer.concat(
    [state.stdin, chunk],
    state.stdin.length + chunk.length
  ));
const commit = (answer) => process.stdout.write(answer);
//
const main = (args) => {
  let data = parseInt(state.stdin.toString("utf8"));
  let solution = "NO";
//   if (data < 1 || data > 100) return commit(solution);

  for (let i = 1; i < data; i++) {
    let part = (data - i) % 2 ===0;
    if (i % 2 === 0 && part) {
      solution = "YES";
      commit(solution);
      return;
    }
  }
  commit(solution);
};

process.stdin.on("data", consume).on("end", main);

    var arbuz = readline();
    arbuz = parseInt(arbuz);
    print(devideWaterMellon(arbuz))

function devideWaterMellon(weight) {
    var result = 'NO';
    for (var index = 2; index < weight; index++) {
        if (index % 2 == 0 && ((weight - index) % 2 == 0) && weight > 3) {
            result = 'YES'
            break;
        }
    }
    return result
}

const state = { stdin: Buffer.alloc(0) };
const consume = (chunk) =>
  (state.stdin = Buffer.concat(
    [state.stdin, chunk],
    state.stdin.length + chunk.length
  ));
const commit = (answer) => process.stdout.write(answer);
//
const main = (args) => {
  let data = parseInt(state.stdin.toString("utf8"));
  let solution = "NO";
  if (data < 1 || data > 100) return commit(solution);

  // divide the watermelon into two parts,
  // each of them weighing even (%2==0) number of kilos;

  for (let i = 1; i < data; i++) {
    let part = (data - i) % 2 ===0;
    if (i % 2 === 0 && part) {
      solution = "YES";
    //   console.log(data, partOne, partTwo)
      commit(solution);
      return;
    }
  }
  commit(solution);
};

process.stdin.on("data", consume).on("end", main);

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', function(line){
    const weight = parseInt(line);
    if(weight <= 2 || weight % 2 !== 0) {
        console.log("NO");
    } else {
        console.log("YES");
    }
})

    var arbuz = readline();
    arbuz = parseInt(arbuz);
    write(devideWaterMellon(arbuz))

function devideWaterMellon(weight) {
    var result = 'NO';
    for (var index = 2; index < weight; index++) {
        if (index % 2 == 0 && ((weight - index) % 2 == 0) && weight > 3) {
            result = 'YES'
            break;
        }
    }
    return result
}

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

// single line input
readline.on('line', line => {
  readline.close(), console.log(parseInt(line) % 2 === 0 && parseInt(line) > 2 ? "YES" : "NO");
});

var weight = readline();

if(weight <= 100 && weight >= 1){
    if(weight > 2 && weight % 2 == 0){
        print("YES");
    }else{
        print("NO");
    }
}

const w = readline()
if (w <= 2){
    print('NO')
} else if ( w % 2 == 0){
    print('YES')
} else {
    print('NO')
}

let readline = require('readline');
let rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});

let input = [];
rl.on('line', function(line) {
	input.push(line);
	if (input.length === 1) {
		waterMelon(parseInt(input[0]));
		rl.close();
	}
});

let waterMelon = (input) => {
	let start = 1;
	let end = input - 1;
	let result = 'NO';
	for (let i = start; i <= end; i++) {
		if (i % 2 === 0 && end % 2 === 0) {
			result = 'YES';
		}
		end--;
	}
	console.log(result);
};

// Problem #    : 4A
// Created on   : 2019-01-15 00:36:24
process.stdin.resume();
process.stdin.setEncoding("utf8");

var input = "",
  readline,
  print;

process.stdin.on("data", function(chunk) {
  input += chunk;
});

process.stdin.on("end", function() {
  input = input.split("\n");
  print = function(data) {
    process.stdout.write(data + "\n");
  };
  var inputLineIndex = 0;
  readline = function() {
    return inputLineIndex >= input.length ? undefined : input[inputLineIndex++];
  };
  process.exit(main() || 0);
});

function main() {
  // Your code here
  let l = readline();
  let n = Number(l);
  if (n > 2 && n % 2 == 0) {
    print("YES");
  } else {
    print("NO");
  }

  return 0;
}

process.stdin.resume();
process.stdin.setEncoding("utf8");

// var getline;
var input = "";
var read;
var writeline = (x) => process.stdout.write(x + "\n");
var write = (x) => process.stdout.write(x);

process.stdin.on("data", (chunk) => input += chunk);
process.stdin.on("end", () => {
    // input = input.split(/\r?\n/);
    // getline = () => input.shift();
    input = input.trim().split(/\s+/);
    read = () => input.shift();
    process.exit(main() || 0);
});

function main() {
    let l;
    while ((l = read()) !== undefined) {
        let x = parseInt(l);
        if (x === 0 || (x > 2 && x % 2 === 0)) {
            writeline('YES')
        } else {
            writeline('NO')
        }
    }
    return 0;
}

var w = readline();
print(w%2===0 && w>2 ? "YES":"NO");

var line = readline()
// var firstLine = lines[0]

print((line % 2 === 0 && line > 2) ? 'YES' : 'NO')

const x = parseInt(readline());
    if (x < 4) {
        print('NO');
    }
    else if (x % 2) {
        // console.log('NO');
        print('NO');
    } else {
        // console.log('YES');
        print('YES');
    }

function printAans()
{
	var weight;

	weight=readline();

	if( weight!=2 )
    {
        if(weight%2===0)print("YES");
        else print("NO");

    }
    else print("NO");

}
printAans();

    var weight;

	weight=readline();

	if( weight!=2 )
    {
        if(weight%2===0)print("YES");
        else print("NO");

    }
    else print("NO");

function printAnss()
{
	var weight;

	weight=readline();

	if( weight!=2 )
    {
        if(weight%2===0)print("YES");
        else print("NO");

    }
    else print("NO");

}
printAnss();

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('', (input) => {
    if (input > 2 && input % 2 === 0) {
        console.log('YES')
    } else {
        console.log('NO')
    }
    rl.close();
});

    const map = {
        true: 'YES',
        false: 'NO'
    }

    const w = readline().split(' ').map(i => parseInt(i))[0];
if (w > 2) {
    write(map[(w - 2) % 2 === 0]);
} else {
    write('NO')
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    let theNum = readline();

    let result = isTrue(theNum);

    if(result) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}

function isTrue(theNum) {
    if(theNum == 2) {
        return false;
    }
    let secondNum = theNum - 2;
    for(let i = 2; i <= theNum; i+=2, secondNum-=2) {
        if(i + secondNum == theNum) {
            if(i % 2 == 0 && secondNum % 2 == 0) {
                return true;
            }
        }
    }
    return false;
}

var input = readline().split(' ');
var check = false;
for(var i=2;i<input[0] ; i+=2) {
  if( (input[0] - i) % 2 == 0 ) check=true;
}
if(check) print("YES");
else print("NO");

var fullWeight = readline(),
	vasyaWeight = petyaWeight = 0,
	output = 'NO';

for(var i = 1; i < fullWeight; i++){
	vasyaWeight = i;
	petyaWeight = fullWeight - vasyaWeight;
	if(!(vasyaWeight%2) && !(petyaWeight%2)){
		output = 'YES';
		break;
	}
}

write(output);

var w =  readline();
if (w == 2){
    print("NO");
}
else if(w % 2 == 0){
        print("YES")
    }

else
    {
        print("NO")
    }

const readline = require('readline')

class ReadStream {
    lines = []

    currPromise = undefined

    readlineHandler = input => {
        this.lines.push(input)
    }

    constructor() {
        this.rl = readline.createInterface({
            input: process.stdin,
            output: process.stdout
          });

        this.rl.on('line', this.readlineHandler)
    }

    async next() {
        this.currPromise = new Promise((resolve, reject) => {
            const tempPromise = this.currPromise ? this.currPromise : Promise.resolve()

            tempPromise.then(_ => {
                if (this.lines .length) {
                    resolve(this.lines.shift())
                }
                else {
                    this.rl.off('line', this.readlineHandler)
                    this.rl.once('line', (input) => {
                        resolve(input)
                        this.rl.on('line', this.readlineHandler)
                    })
                }
            })

        })
        return this.currPromise
    }

    close() {
        this.rl.off('list', this.readlineHandler)
        this.rl.close()
    }
}

const cin = new ReadStream()

async function main() {
    const weight = parseInt(await cin.next())

    if (weight % 2 === 0 && weight > 2) {
        console.log('YES')
    } else {
        console.log('NO')
    }

    cin.close()
}

main()

const readline = require('readline')

class ReadStream {
    lines = []

    currPromise = undefined

    readlineHandler = input => {
        this.lines.push(input)
    }

    constructor() {
        this.rl = readline.createInterface({
            input: process.stdin,
            output: process.stdout
          });

        this.rl.on('line', this.readlineHandler)
    }

    async next() {
        this.currPromise = new Promise((resolve, reject) => {
            const tempPromise = this.currPromise ? this.currPromise : Promise.resolve()

            tempPromise.then(_ => {
                if (this.lines .length) {
                    resolve(this.lines.shift())
                }
                else {
                    this.rl.off('line', this.readlineHandler)
                    this.rl.once('line', (input) => {
                        resolve(input)
                        this.rl.on('line', this.readlineHandler)
                    })
                }
            })

        })
        return this.currPromise
    }

    close() {
        this.rl.off('list', this.readlineHandler)
        this.rl.close()
    }
}

const cin = new ReadStream()

async function main() {
    const weight = parseInt(await cin.next())

    if (weight % 2 === 0 && weight > 2) {
        console.log('YES')
    } else {
        console.log('NO')
    }

    // cin.close()
}

main()

var x = readline();

 if (x % 2 === 0 && x > 2 )
    print("yes")
else
    print("no")

var line = readline().split(' ');
if ( line[0] > 3 && line % 2 == 0 ) {
    print('YES') ;
}
else {
    print('NO');
}

var num = parseInt(readline());
if (num % 2 || num < 4)
{
    print('NO');
}
else
{
    print('YES');
}

// readline = require('readline')
let stdinInput = '';

// //file
//     var fs = require('fs');
//    const inputfile = '_in.txt';
//    const outputfile = '_out.txt';
//    fs.writeFileSync(outputfile, '');
//    var myInterface = readline.createInterface({
//      input: fs.createReadStream(inputfile),
//    });
//    myInterface.on('line', function (line) {
//       stdinInput += line+'\n';
//     }).on('close', () => {
//            main();
//         process.exit(0);
//     })
   /*
   *  Api Scanner
   */
  class Scanner {
    constructor() {
      this.index = -1;
      this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
    }

    nextLine() {
      this.index += 1;
      return this.lines[this.index].trim();
    }
    nextArray(fn) {
      const array = this.nextLine().split(' ');
      return fn === String ? array : array.map(fn);
    }

    hasNext() {
      return this.index < this.lines.length;
    }
  }

  process.stdin.resume();
  process.stdin.setEncoding('utf-8');
  process.stdin.on('data', (input) => { stdinInput += input; });
  process.stdin.on('end', () => { main(); });

var n;
function main() {
    const is = new Scanner();

    // const s = is.nextArray(Number);
    // const t = is.nextArray(Number);
    // // const k = is.nextArray();

    n = parseInt(is.nextLine());
    // console.log(n);

    if(kt()==1)
        console.log("YES");
		else
        console.log("NO");
  }

  function kt(){
    for(var i=2; i<n; i=i+2)
	{
		if((n-i)%2==0)
			return 1;
	}
	return 0;
}

var line = readline().split(' ');
if ( line[0] > 3 && line[0] % 2 == 0 ) {
    print('YES') ;
}
else {
    print('NO');
}

var weight = readline();
print(weight && weight > 2 && !(weight % 2) ? "YES" : "NO");

var a = readline();
a = parseInt(a);
if (a % 2 === 0 && a !== 2){
    print("YES");
}else{
    print("NO");
}

var w = readline();
if (w % 2 == 0 && w > 2){
	print("YES");
} else {
	print("NO")
}

var input = readline().split(' ')[0];
print((input > 2 && !(input % 2)) ? 'YES' : 'NO');

process.stdin.resume();
process.stdin.setEncoding('utf8');
let input= '', readline, cout;
process.stdin.on('data', (chunk) => input+=chunk);
process.stdin.on('end', () => {
    input = input.split('\n');
    cout = (data) => process.stdout.write(data+'\n');
    var inputLineIndex = 0;
    readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};
    process.exit(main() || 0);
});

function main(){
    let a = readline();
    if(a > 2 && a % 2 === 0) console.log("YES");
    else console.log("NO")
    return 0;
}

x = readline();
if (!(x & 1) && x != 2)print("YES"); else print("NO");

process.stdin.resume();
process.stdin.setEncoding('utf8');
var input= '', readline, cout;
process.stdin.on('data', function(chunk) {
    input+=chunk;
});
process.stdin.on('end', function() {
    input = input.split('\n');
    cout = function(data) {process.stdout.write(data+'\n')};
    var inputLineIndex = 0;
    readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};
    process.exit(main() || 0);
});

function main()
{
    let a = readline();
    if(a > 2 && a % 2 === 0) console.log("YES");
    else console.log("NO")
    return 0;
}

var kilos = +readline();
var isEven = false;
for (var i = 1; i < kilos; i++) {
    for (var j = kilos - 1; j > 0; j--) {
        if (i % 2 === 0 && j % 2 === 0 && i + j === kilos) {
            isEven = true;
            print('YES');
            break;
        }
    }
    if (isEven) break;
}
if (!isEven) print('NO');

var input = null;
//input = ['2'];
function main(input) {
    var w = parseInt(input[0]);
    if (w == 2)
        solution('NO');
    for (var i = 2; i < 50; i += 2) {
        if (w % 2 == 0)
            solution('YES');
    }
    solution('NO');
}
///////////////////////////////////////////////////////////////////////////////////////
if (!input) {
    var input_1 = '';
    process.stdin.on('data', function (char) { return input_1 += char; });
    process.stdin.on('end', function () {
        var EOL = require('os').EOL;
        var inputs = input_1.split(EOL).slice(0, -1);
        main(inputs);
    });
}
else
    main(input);
function solution(data) {
    console.log(data);
    process.exit(0);
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
  const x = readline();
  // process.stdout.write('hello')
  console.log(x % 2 == 0 && x > 3 ? 'YES' : 'NO');
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    divideEvenly(lines[0]);
});

function divideEvenly(w){
    if (w < 3 || w > 100) return console.log('NO');
    if (w % 2 === 0 ){ return console.log('YES')}
    else{ return console.log('NO');}
}

process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

function solveMeFirst(a) {
  // Hint: Type return a+b below
  return a > 2 && a % 2 === 0 ? "YES" : "NO";
}

function main() {
    var a = parseInt(readLine());

    var res = solveMeFirst(a);
    console.log(res);
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    console.log(divideEvenly(lines[0]));
});

function divideEvenly(w){
    if (w < 3 || w > 100) return 'NO';
    if (w % 2 === 0 ) return 'YES'
    return 'NO';
}

var ent = parseInt(readline());
if (ent<=2) print("NO");
else
{
    if (ent%2==0) print("YES");
    else print("NO");
}

var stdin = process.stdin;
stdin.setEncoding( 'utf8' );
stdin.on( 'data', function( key ){
    const weight = parseInt(key);
    const available = (weight !== 2) && (weight % 2 === 0);
    process.stdout.write(available ? "YES" : "NO" );
});

"use strict";

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", inputStdin => {
  inputString += inputStdin;
});

process.stdin.on("end", function() {
  inputString = inputString
    .replace(/\s*$/, "")
    .split("\n")
    .map(str => str.replace(/\s*$/, ""));

  main();
});

function readLine() {
  return inputString[currentLine++];
}

function main() {
  const firstLine = readLine();
  const weight = parseInt(firstLine, 10);
  // const a = readLine().split(' ').map(aTemp => parseInt(aTemp, 10));

  console.log(watermelon(weight));
}

function watermelon(weight) {
  return weight === 2 || (weight & 1) === 1 ? "NO" : "YES";
}

var n =parseInt(readline());
var b = false;
for (var i = 4; i <= n; i+=2){
    if(i == 100) break;
        if(((i % 2 === 0) && (n-i) % 2 ===0) || n == 4)
            b = true;

    }
 write(b  ? "YES":"NO");

//nodejs v4.2.6
process.stdin.resume();
	process.stdin.setEncoding('utf8');
	//Taking a usr input
	process.stdin.on('data', function (text) {
			//Printing out user input
			var input = parseInt(text)
				if(input===2){
					console.log('NO')
				}else
				if(input%2 === 0){
					console.log('YES');
				}else{
					console.log('NO')
				}
	});

// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);

    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(arr) {
    let nLines = arr.split('\n');
    let nWeight = nLines[0];
    let quotient = nWeight % 2 === 0 && nWeight > 2 ? 'yes' : 'no';
    return quotient;

}

var input = readline();
(input > 2 && input%2 == 0) ? print("YES") : print("NO");

(function f(){
var n = parseInt(readline());
	if(n!=2&&n%2==0){
		//console.log("NO");
		 print("YES");
	}
	else
		//console.logt("YES");
	 print("NO");

})();

(function f(){
	 var nums = readline().split(' ');
    var n = nums[0];
//	var n = parseInt(s);
	if(n!=2&&n%2==0){
		//console.log("NO");
		 print("YES");
	}
	else
		//console.logt("YES");
	 print("NO");

})();

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    const parameterVariable = readLine();
    const line2 = readLine();

    if(parameterVariable > 2 && parameterVariable % 2 === 0) console.log('YES')
    else console.log('NO')

}

function checkDivide(weight){
    if( weight % 2 === 0 && weight !== 0 && weight != 2){
      print("YES");
    }
    else {
      print("NO");
    }

}

checkDivide(readline());

process.stdin.on('data', (n) => {
  if (n > 3 && n % 2 === 0) console.log('YES');
  else console.log('NO');
});

var n = parseInt(readline());
print (n!=2 && n % 2 == 0 ? "YES" : "NO");

var a= readline();
if(a>2&&a%2===0) print("YES");
else print("NO");

const input = readline();
const num = parseInt(input);

if ((num>2) && (num%2 === 0)) {
    print("YES");
} else {
    print("NO");
}

var readline = require('readline'),
    rl = readline.createInterface(process.stdin, process.stdout);

rl.on('line', function (line) {

    var n=line.split(' ')
    n%2==0 && n!=2 ? console.log("YES") : console.log("NO");
    rl.close();

}).on('close', function () {

    process.exit(0);
});

var weight = parseInt(readline('weight? '));
if (weight%2===0 && weight !==0 && weight>2)
print('YES');
else
print('NO');

var input = readline();
var w = parseInt(input)

if(w>2 && w%2===0){
	print('YES');
}
else{
	print('NO');
}

const { read } = require('fs');

const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

readline.question('', w => {
    if(parseInt(w) %2==0 && parseInt(w)>=4){
        console.log('YES');
    }
    else{
        console.log('NO');
    }
    readline.close();
})

'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

main();
});

function readLine() {
    return inputString[currentLine++];
}

function solve(n) {
    return n%2===0 && n>=4 ? `YES`: `NO`;
}

function main() {

    const nk = readLine().split(' ');

    const n = parseInt(nk[0], 10);

    let result = solve(n);
    console.log(result);
}

// let x = readline()
//   .split(" ")
//   .map(function (x) {
//     return parseInt(x);
//   });

var x = readline();

if (x > 2 && x % 2 == 0) {
  write("YES");
} else {
  write("NO");
}

const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

// var numbers = readline().split(" ").map(function(x) { return parseInt(x); });

readline.on('line', line => {
    readline.close();

    const number = line.split(" ")[0];

    if (number > 2 && number % 2 === 0) {
        console.log('YES');
    } else {
        console.log('NO');
    }
});

const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

// read each line
rl.on("line", (lineInput) => {
  if (lineInput % 2 == 0 && lineInput != 2) {
    console.log("Yes");
  } else console.log("NO");
});

// when all file readed
rl.on("close", () => {});

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  rl.question("",function (x) {

    if (x%2 === 0 && x!=2 ) {
        console.log('YES');

    }else  {
        console.log('NO')
    }

  })

var x;
x = Number(readline());

if((x % 2 == 0) && (x > 2)){
  print("YES");
}
else{
  print("NO");
}

const readline = require('readline');
const z=2 ;
const x=1;
const c=100
const rl = readline.createInterface({
  input: process.stdin
});
rl.on('line', (input) => {
  if (input.trim()>=x && input.trim()<=c){
  if (input.trim() % z != 0 || input.trim()==2 )
  {
    console.log("NO");
  }
  else
  {
    console.log("YES");
  }
}
  rl.close();
});

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inp = 0
process.stdin.on("data",input=>{
    inp = input
})
process.stdin.on("end",input=>{

    main();

})

function main(){
if(inp%2===0&&inp!=2){console.log("YES")} else {console.log("NO")}}

function divideBerry(w) {
    if (w % 2 === 0 && w !== 2) {
        print('YES');
    } else {
        print('NO');
    }
}

var input = readline();
divideBerry(parseInt(input));

var w = Number(readline());

function delitarbuz() {
	if (w%2 === 0 && w !== 2 && w !== 0){
		return ('Yes');
	}
	else if (w%2 !== 0 || w === 2 || w ===0){
		return ('No');
	}
  return 0;
}

print(delitarbuz());

// Input
'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

//main
function main() {
    var n = parseInt(readline());
    console.log((n<=2 || n%2) ? "NO" : "YES");
}

function main(){
  var n = +readline();
  var m = n/2;
  if(n == 2 || m.toString().includes("."))
    print("NO");
  else
    print("YES");
}

main();

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('', (w) => {
  main(w);
  rl.close();
});

function main(watermelon) {
  watermelon = parseInt(watermelon);
  let numbersPar = fragWatermelon(watermelon);
  let totalNumbers = numbersPar.length;
  if (numbersPar.length >= 1 && (numbersPar[0] + numbersPar[totalNumbers-1]) === watermelon){
    console.log('YES')
  } else {
    console.log('NO')
  }
}

function fragWatermelon(watermelon) {
  let numbersPar = [];
  for(let i = 1; i < watermelon; i++){
    if ((i%2) === 0){
      numbersPar.push(i)
    }
  }
  return numbersPar;
}

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

function solution(input){
    if(input === "2"){
        return "NO"
    }
    return input % 2 === 0 ? "YES" : "NO"
}

rl.on('line', function(line){
    console.log(solution(line))
})

// https://codeforces.com/problemset/problem/4/A

function main(weight) {
  process.stdout.write(weight > 2 && weight % 2 === 0 ? 'YES' : 'NO')
}

// Handle standard input
process.stdin.resume()
process.stdin.setEncoding('utf-8')

let inputString = ''

process.stdin.on('data', (inputStdin) => inputString += inputStdin)
process.stdin.on('end', () => main(+inputString.trim()))

var w = readline();

if ((w % 2 === 0) && (w != 2)) {
    print("YES");
} else {
    print("NO");
}

let i = ''

function main(w) {
    // let dem = 0;
    // for(let i = 2; i <= w ; i++){
    //     if(w % i == 0){
    //         dem++;
    //     }
    // };
    //
    // if(dem >= 2){
    //     console.log("YES");
    // }else {
    //     console.log("NO");
    // }
    if(w % 2 == 0 && w > 2){
        console.log("YES");
    }else {
        console.log("NO");
    }
}
// main(6);

process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    const line1Array = lines[0].split(' ').map(x => parseInt(x))
    const w = line1Array[0]

    main(w);
})

// const readline = require('readline');

// const rl = readline.createInterface({
//   input: process.stdin,
//   output: process.stdout
// });

// let w;
// rl.on('line', (input) => {
//   w = input;
//   console.log(w % 2 === 0 ? 'YES' : 'NO');

//   rl.close();
// });

const numbers = readline();
print(numbers % 2 === 0 ? 'YES' : 'NO');

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', (weight) => {
    if (weight <= 3) console.log('NO');

    var answer = weight % 2;
    console.log(answer === 1 ? 'NO' : 'YES');
    rl.close();
});

const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
})

readline.question("", (weight) => {
    if (weight % 2 == 0)
        console.log("YES")
    else
        console.log("NO")
    readline.close()
})

(function f(s){
	var n = 5;//  parseInt(s);
	if(n>2&&n%(2!==0)){
		//console.log("NO");
		print("NO");
	}
	else
		//console.logt("YES");
	  print("YES");

})();

#!/usr/bin/env nodejs

// 4A - Watermelon

function main(stdin) {
  console.log(parseInt(stdin) % 4 === 0 ? "YES" : "NO");
}

main(require("fs").readFileSync(0, "utf-8"));

(function f(s){
	var n =  parseInt(s);
	if(n>2&&n%2!=0){
		 print("YES");
	}
	else
		print("NO");

	 return 0;
})();

var myArgs = process.argv.slice(2);
if(myArgs[0]%2==0)console.log('YES');

function selicomArbuz(w) {
  var selicom = w % 2
  if (selicom === 0) {
    print("YES")
  } else {
    print("NO")
  }
}

selicomArbuz()

let state = {stdin:Buffer.alloc(0)}
process.stdin
    .on('data', chunk=> {
        state.stdin = Buffer.concat([state.stdin, chunk], state.stdin.length+chunk.length )
    })
    .on('end', ()=> {
        let data = state.stdin.toString('utf8')
        process.stdout.write( (data/2)%2===0 ? 'YES': 'NO')
    })

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  rl.question("",function (x) {

    if (x%2 === 0 || x===2 ) {
        console.log('YES');

    }else  {
        console.log('NO')
    }

  })

(function f(s){
	var n = parseInt(s);
	if(n>2&&n%2===0)
		print("YES");
	else
	    print("NO");
})();

    var n = +readline();

	if (n%2==0){
        print("Yes")
    } else {
        print("No")
    }

function f(chislo){
 this.ch  = chislo;

	if(chislo%2==0)
		return true;

	return false;
}

var n = readline();

if (n % 2 === 0) {
    print("YES")
} else if (n == 2) {
    print("NO")
} else {
    print("NO")
}

console.log(parseInt(process.argv[2])%2 === 0 ? "YES":"NO")

var value = parseInt(readline())
var response = value % 2 == 0 && (value / 2) % 2 == 0? "YES" : "NO"
print(response)

const a = parseInt(readline());
const d = a % 2 === 0;

d ? r = 'YES' : r = 'NO';

print(r);

a = readline();
if (a <= 2 ){
    print("NO")
}
if (a % 2 === 0){
    print("YES");
}
print("NO") ;

var b = readline();
if(b<2)print("NO")
print((b%2===0)?"YES":"NO");

function Watermelon(w) {
    if(w % 2 == 0)  {
        print('yes');
    } else {
        print('no');
    }
}

var w = readline();

    print('input');
    print(w);

if(w>=1 && w<=100) {
    print('output');
    Watermelon(w);
}  else {
    print('wrong input');
}

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('', (answer) => {
  if (answer % 2 === 0) {
      console.log('YES');
  } else {
      console.log('NO');
  }

  rl.close();
});

	var n = readline();

	print(n % 2 === 0 ? "YES" : "NO");

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline
// a + b

if(readline%2==0){
print('YES');
}else{
    print('NO');
}

const wWeight = readline();

checkIfWatermelonIsEven(wWeight);

function checkIfWatermelonIsEven(w){
    print(((w/2)%2?'NO':'YES'));
}

var stdin = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function(data) {
  stdin += data;
});
process.stdin.on("end", function() {
  main(stdin);
});

const debug = 0;
var log = console.log;
var dbg = debug ? console.log : _ => {};

/////////////// ignore above this line ////////////////////

function main(stdin) {
  log(stdin % 2 ? "NO" : "YES");
}

var x;
x = readline();

if(Number(x) % 2 == 0){
  print("YES");
}
else{
  print("NO");
}

function watermellon(n){if (n % 2 === 0) {return "YES";} else {return "NO";}}

process.stdin.on('data', function(chunk){
   console.log(Number(chunk) % 2 === 0);
});

function selicomArbuz(w) {
  var selicom = w % 2
  if (selicom === 0) {
    return "YES"
  } else {
    console.log("NO")
  }
}

var a=readline();
evenOdd(a);

function evenOdd(weight){
   if(weight%2===0){
     print('YES')

   }else{
       print('NO')
   }
}

a=readline();
if (a <= 2){
    print("NO")
}
if (a % 2 === 0){
    print("YES");
}
print("NO") ;

var num = readline();

if (num % 2 === 0 && num !== 2) {
  var isOk = true;
  for (var i = 2; i <= num; i+=2) {
    if ((num - i) % 2 !== 0) {
      isOk = false;
    }
  }

  print(isOk ? 'YES' : 'NO')
} else {
  print('NO')
}

var n = readline();

if(n%2 !== 0 && n ==2) {
  print('NO');
} else {
  print('YES');
}

var lines = readline().split('\n').join('')
var firstLine = lines[0]

print(firstLine % 2 === 0 ? 'YES' : 'NO')

process.stdin.on('data', chunk => console.log(chunk.toString() % 2 === 0 ? "YES":"NO"))

var n = readline();
if (n % 2 === 0) {print('YES');} else {print('NO');}

const input = readline();
const num = parseInt(input);

if ((num>2) && (num%2 === 0)) {
    //console.log("YES");
} else {
    //console.log("NO");
}

var arr = [];
function watemelon(input){
    if((input % 2) === 0){
        print('YES');
    } else {
        print('NO');
    }
}

var n = readline();
if (n % 2 === 0 && n > 2 && n < 100)  {print('YES');} else {print('NO');}

var a= readline().split(" ");
if(a%2===0){
    var b=a/2;
    if(b%2===0){
        print("YES");
    }
    else {
        print("NO");
    }
}
else print("NO");

num = process.argv[0]

function test(t) {
    if ( t<1 || t>100 ) {
        console.log("input error")
        process.exit()
    }
}

test(num)

for(let i = 1; i < num; i++) {
    if (i%2 == 0) {
        let m = num-i
        if (m%2 == 0) {
            console.log("YES");
            process.exit();
        }

    }
}
console.log("NO")

var w = readline();
	if(w==2)
	{
		print("NO");
	}
	if(w%2==0)
	{
		print("YES");
	}
	else
	{
		print("NO");
	}

let i = ''

function main(w) {
    let tong = 0;
    for(let i = 1; i < w ; i++){
        if(i % 2 === 0){
            tong += i;
        }
    }

    if(tong == w){
        console.log("YES");
    }else {
        console.log("NO");
    }
}
// main(5);

process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    const line1Array = lines[0].split(' ').map(x => parseInt(x))
    const w = line1Array[0]

    main(w);
})

var x;
x = readline();
if (x === 2 || (x % 2) == 1) {
    print("NO\n");
} else {
    print("YES\n");
}

var num = readline();

print(num % 2 === 0 ? 'YES' : 'NO');

var w = readline();

w > 0 && w % 2 === 0 ? print('YES') : print('NO');

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {

    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    console.log(lines);

})

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

readline.on('line', line => {
  readline.close(), problem(parseInt(line));
});

function problem(i) {
    console.log(i % 2 === 0);
}

#!/usr/bin/env nodejs

// 4A - Watermelon

function main(stdin) {
  console.log(parseInt(stdin) % 2 === 0 ? "YES" : "NO");
}

main(require("fs").readFileSync(0, "utf-8"));

function watermelon (){
	w = prompt ("Introduce kg");
	w = parseInt(w);
	if ((w>=1)&&(w<=100)&&(w%2===0)&&(w>2)){
		alert ("YES");
	} else {alert ("NO");
	}
}

function watermelon(num) {
    var media;
    media = num / 2;
    if (media % 2 == 0) {
        return "YES";
    }

    return "NO";
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    const parameterVariable = readLine();
    const line2 = readLine();

    console.log(line2)
    console.log(typeof line2)

    if(parseInt(line2) % 2 === 0) {
        console.log('YES')

    }
    else {console.log('NO');}

}

var cli = +readline() / 2;
if (cli % 2 === 0) {
    print('YES');
} else {
    print('NO');
}

//nodejs v4.2.6
process.stdin.resume();
	process.stdin.setEncoding('utf8');
	//Taking a usr input
	process.stdin.on('data', function (text) {
			//Printing out user input
			var input = parseInt(text)
				if(input%2 === 0){
					console.log('Yes');
				}else{
					console.log('No')
				}
	});

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
  const { EOL, } = require('os');
  const weight = i.split(EOL);
  const res = (weight) => weight % 2 === 0 ? 'YES' : 'NO';
  const ver = res(weight);

  console.log(weight, ver);
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    let theNum = readline();

    let result = isTrue(theNum);

    if(result) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}

function isTrue(theNum) {
    let secondNum = theNum - 2;
    for(let i = 2; i <= theNum; i+=2, secondNum-=2) {
        if(i + secondNum == theNum) {
            if(i % 2 == 0 && secondNum % 2 == 0) {
                return true;
            }
        }
    }
    return false;
}

var w = readline();

if (w % 2=== 0) {
    print("YES");
} else {
    print("NO");
}

function divideBerry(w) {
    if (w % 2 === 0 && w !== 2) {
        print('YES');
    } else {
        print('NO');
    }
}

divideBerry(readline());

function task1(a){if((a/2)%2==0){return "yes"}else{ return "no"}};

var weight = readline();

if(weight <= 100 && weight >= 1 && weight % 2 == 0){
    print('YES');
}else{
    print('NO');
}

var input = readline().split(' ');
var watermelon_weight = input[0];

for(var even = 0; even <= watermelon_weight; even += 2){
    if(watermelon_weight === 2) { var verdict = 'NO'; break;}
    var verdict = watermelon_weight%2 === 0 ? 'YES' : 'NO';
    if(verdict === 'YES') { break; }
}
print(verdict);

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on("end", (_) => {
  inputString = getArray(inputString, '\n');

  main();
});

function getArray(str, delimiter) {
  return str
    .trim()
    .split(delimiter)
    .map((string) => {
      return string.trim();
    });
}

function readLine() {
  return inputString[currentLine++];
}

function pi(str) {
  return parseInt(str);
}

function main() {
  var n = readLine();
  if (pi(n) %2 === 0 && pi(n) > 0) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}

const state = {stdin:Buffer.alloc(0)}
const consume = chunk => state.stdin = Buffer.concat([state.stdin, chunk], state.stdin.length+chunk.length )
const commit = answer => process.stdout.write(answer)
//
const main = args => {
    let data = parseInt(state.stdin.toString('utf8'))
    let solution = 'NO'
    if(data < 1 || data > 100) return null

    // divide the watermelon into two parts,
    // each of them weighing even number of kilos;

    for(let i = 1; i < data; i++){
        let partOne = data-i
        let partTwo = data-partOne
        if( partOne % 2 == 0 && partTwo % 2 == 0 ) {
            solution = 'YES'
            return commit(solution)
        }
    }
}

process.stdin
    .on('data', consume)
    .on('end', main)

var a= parseInt(readline().split(" "));
if(a%2===0){
    print("YES");
}
else
{
    print("NO");
}

function f(chislo){
	if(chislo&1)
		console.log(YES);
	else
	console.log(NO);
}

// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);

    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(arr) {
    let nLines = arr.split('\n');
    let nWeight = nLines[0];
    let quotient = (nWeight / 2) % 2 == 0 ? 'yes' : 'no';
    return quotient;

}

function main(){
  var n = +readline();
  if(n == 2 || n.toString().includes("."))
    print("NO");
  else
    print("YES");
}

main();

let i = ''

function main(w) {
    let dem = 0;
    for(let i = 1; i < w ; i++){
        if(w % i == 0){
            dem++
        }
    };

    if(dem >= 2){
        console.log("YES");
    }else {
        console.log("NO");
    }
}
// main(5);

process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    const line1Array = lines[0].split(' ').map(x => parseInt(x))
    const w = line1Array[0]

    main(w);
})

"use stict"

var current = write();
if(current > 2 && current % 2 == 0){
  print("YES");
}
else{
  print("NO");
}

const readline = require('readline');

const r1= readline.createInterface({
	input: process.stdin,
	output: process.stdout
})
r1.on('line', (line) => {
	watermelon(+line)
	r1.close();
})

function watermelon(kg) {
	return kg % 2 ? 'NO' : 'YES'
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    const parameterVariable = readLine();
    const line2 = readLine();

    if(parameterVariable >= 2 && parameterVariable % 2 === 0) console.log('YES')
    else console.log('NO')

}

var input = readline().split(' ');
var watermelon_weight = input[0];
print((watermelon_weight/2)%2 === 0 ? 'YES' : 'NO');

const a = parseInt(readline());
const d = a % 2 === 0;

d ? r = 'YES' : r = 'NO';

print(r);

process.stdin.resume();
process.stdin.setEncoding('ascii');

const readable = process.stdin;

readable.on('data', (data) => {
	let a = data
 	if (a !== null) {
 		console.log(a % 2 === 0 ? "YES" : "NO")
 		process.exit(0)
 	}
})

function divideEvenly(w){
    if (w < 1 || w > 100) return console.log('NO');
    if (w % 2 === 0) return console.log('YES');
    return console.log('NO');
}
console.log(divideEvenly());

const num = parseInt(readline());
if(num%2===0){
    print('YES');
}
else{
    print('NO');
}

function divide(weight){
  return weight > 2 && weight % 2 === 0;
}

var numbers = readline().split(" ").map(function(x) { return parseInt(x); });

write(numbers)
write(numbers[0])
write('test')

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
   processData(_input);
});

function processData(input) {
    const values = input.split('\n')
    if (values && values.length > 0 && values[0]%2 === 0) {
        const temp = Math.floor(values[0]/2)
        if (temp%2 === 0) {
                        console.log("YES")

        } else {
                        console.log("NO")

        }

    } else {
            console.log("NO")
    }
}

var w = readline();

w%2 === 0 ? print('YES') : print('NO');

var w = readline();
    print('input');
    print(w);

    print('output');
    (w % 2 == 0 && w!=2)? print('YES'): print('NO');

(function f(){
	 var nums = readline().split(' ');
    var n = nums[0];
//	var n = parseInt(s);
	if(n=>2&&n%2!==0){
		//console.log("NO");
		print("NO");
	}
	else
		//console.logt("YES");
	  print("YES");

	return 0;
})();

var lines = readline().split('\n').join('')
var firstLine = lines[0]

print(firstLine % 2 === 0 && firstLine > 2) ? 'YES' : 'NO'

const readline = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
let input;
readline.on("line", (line) => {
  readline.close(), input=line;
});

console.log(`这是我的输入: ${input}`)

a = readline();
if (a <= 2 ){
    print("NO")
}
if (a % 2 === 0){
    print("YES");
}
print("NO") ;

var kilo = readline();
write((kilo/2)%2? 'NO':'YES');

var w = readline();
	if(w%2==0)
	{
		print("YES");
	}
		else
		{
			print("NO");
		}

var a= readline().split(" ");
if(a%2===0){
    var b=a/2;
    if(b%2===0){
        print("YES");
    }
    else {
        print("NO");
    }
}
else print("NO");

const readline = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

// single line input
// readline.on("line", (line) => {
//   readline.close();
// });

// multi line input
readline.on("line", (line) => {
  const input = +line.split(" ")[0];
  readline.close();
  const half = input / 2;
  if (input % 2 === 0) {
    if (half % 2 === 0) {
      console.log("YES");
      return;
    }
  }
  console.log("NO");
});

function selicomArbuz(w) {
  var selicom = w % 2
  if (selicom === 0) {
    print("YES")
  } else {
    print("NO")
  }
}

selicomArbuz(8);


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  let curr = 0;
  let n = +d;
  let ans = 'NO';

  let inc = 0;
  while (curr <= n) {
    curr = inc * (inc + 1) / 2;
    if (curr === n) {
      ans = 'YES';
    }
    inc++;
  }

  console.log(ans);

  c++;
});

var n = Number(readline())
var i = 1
while (true) {
    if (i * (i+1) / 2 == n) {
        print('YES')
        break
    }

    if (i * (i+1) / 2 > n) {
        print('NO')
        break
    }

    i++
}

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function solve(target) {
	var triangle = 1, naturalNumber = 1;
	while (triangle < target) {
		++naturalNumber;
		triangle += naturalNumber;
	}
	return (triangle == target);
}

function main() {
	var target = parseInt(readline());
	print(solve(target) ? "YES" : "NO");
}

main();

'use strict'

let N = +readline()
print(Number.isInteger(Math.sqrt(1 + 8 * N)) ? 'YES' : 'NO')

var tokenizer;
var index = 0;

function next(){
    while(tokenizer == null || index == tokenizer.length){
        tokenizer = readline().split(" ");
        index = 0;
    }
    var res = tokenizer[index++];
    return res;
}

function nextInt(){
    return parseInt(next());
}

function nextFloat(){
    return parseFloat(next());
}

function solve(){
    var n = nextInt();
    var t = 0;
    var flag = false;
    for(var i = 0; t <= n; ++i){
        if(t == n) flag = true;
        t = (i*(i+1))/2;
    }
    if(flag){
        print("YES");
    } else {
        print("NO");
    }
}
solve();


function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}

function main() {
	var data = tokenizeIntegers(readline()),
		sizeA = data[0], sizeB = data[1];
	data = tokenizeIntegers(readline());
	var winA = data[0], multiple = data[1],
		seeds = parseInt(readline());
	var needWinners = Math.max(0, winA*multiple - seeds),
		needProblems = 0;
	if (winA*sizeB > sizeA) {
		var rounds = Math.floor(needWinners / winA);
		needProblems = rounds * sizeA;
		needWinners -= rounds * winA;
		needProblems += Math.min(sizeA, needWinners * sizeB);
	} else {
		needProblems = needWinners * sizeB;
	}
	print(needProblems);
}

main();

function tokenize(s) {
	return s.split(/\s+/);
}

function tokenize_integers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i++) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}
function nextArray() {
	return tokenize_integers(readline());
}
function nextInt() {
	return parseInt(readline());
	//	return tokenize_integers(readline())[0];
}
function main() {
	var data = nextArray();
	var c = data[0], d = data[1];
	data = nextArray();
	var n = data[0], m = data[1];
	var k = nextInt();
	var needWinners = Math.max(0, n * m - k);
//	print(needWinners);
	var ret = -1;
	for(var x = 0; x <= 10000; x++) {
		var y = needWinners - x * n ;
		y = Math.max(y, 0);
		var tmp = c * x + y * d;
//		if(x < 10)print(tmp);
		if(ret == -1 || tmp < ret) {
			ret = tmp;
		}
	}
	print(ret);
}
main();

function main() {

    var arr1 = readline().split(' ').map(Number);
    var c = arr1[0], d = arr1[1];
    var arr2 = readline().split(' ').map(Number);
    var n = arr2[0], m = arr2[1];
    var k = Number(readline());

    var winners = Math.max(0, n * m - k);

    var problems = -1;

    for (var x = 0; x <= 10000; x++) {
        var y = winners - x * n;
        y = Math.max(y, 0);
        var temp = c * x + y * d;

        if (problems == -1 || temp < problems) {
            problems = temp;
        }
    }
    print(problems);

}

main();

if (!this.readline) print = console.log, readline = require('./readline');

function readNums() {
	return readline().split(' ').map(Number);
}

print(function(cb, ca, na, nb, k) {
	nb -= ~~(k / na);
	k %= na;

	if (nb <= 0) {
		return 0;
	}
	return (Math.min(nb * cb, Math.min((na - k) * ca + (nb - 1) * cb, (na - k) * ca + (nb - 1) * na * ca)));
}.apply(0, readNums().concat(readNums()).concat(readNums())));

if (!this.readline) print = console.log, readline = require('./readline');

function readNums() {
	return readline().split(' ').map(Number);
}

print(function(c, d, n, m, k) {
	m -= Math.floor(k / n);
	k %= n;
	return m <= 0 ? 0 : Math.min(m * c, Math.min((n - k) * d + (m - 1) * c, (n - k) * n + (m - 1) * n * n));
}.apply(0, readNums().concat(readNums()).concat(readNums())));

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}

function main() {
	var data = tokenizeIntegers(readline()),
		sizeA = data[0], sizeB = data[1];
	data = tokenizeIntegers(readline());
	var winA = data[0], multiple = data[1],
		seeds = parseInt(readline());
	var needWinners = winA*multiple - seeds,
		needProblems = 0;
	if (winA*sizeB > sizeA) {
		var rounds = Math.floor(needWinners / winA);
		needProblems = rounds * sizeA;
		needWinners -= rounds * winA;
		needProblems += Math.min(sizeA, needWinners * sizeB);
	} else {
		needProblems = needWinners * sizeB;
	}
	print(needProblems);
}

main();

function tokenize(s) {
	return s.split(/\s+/);
}

function tokenize_integers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i++) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}
function nextArray() {
	return tokenize_integers(readline());
}
function nextInt() {
	return parseInt(readline());
	//	return tokenize_integers(readline())[0];
}
function main() {
	var data = nextArray();
	var c = data[0], d = data[1];
	data = nextArray();
	var n = data[0], m = data[1];
	var k = nextInt();
	var needWinners = Math.max(0, n * m - k);
//	print(needWinners);
	var ret = -1;
	for(var x = 0; x <= 10000; x++) {
		var y = needWinners - c * x * n ;
		y /= d;
		y = Math.max(y, 0);
		var tmp = c * x + y * d;
		if(ret == -1 || tmp < ret) {
			ret = tmp;
		}
	}
	print(ret);
}
main();