n, x, y = map(int, raw_input().split())
if (n / 2 <= x <= n / 2 + 1) and (n / 2 <= y <= n / 2 + 1):
    print "NO"
else:
    print "YES"

n, x, y = map(int, raw_input().split())
n /= 2
if (x, y) in [(a, b) for a in (n, n+1) for b in (n, n+1)]:
    print 'NO'
else:
    print 'YES'

n,x,y= map(int,input().split())
n//=2
if(x==n or x==n+1) and (y==n or y==n+1):
    print('NO')
else:
    print("YES")

n,x,y=map(int,raw_input().split())
hor=[]
ver=[]
for i in range(1,n+1):
	hor.append([n/2,i])
	hor.append([n/2+1,i])
for i in range(1,n+1):
	ver.append([i,n/2])
	ver.append([i,n/2+1])
if [x,y] in hor and [x,y] in ver:
	print "NO"
else:
	print "YES"

n, x, y = map(int, raw_input().split())
n /= 2
if (x, y) in ((n, n), (n+1, n), (n, n+1), (n+1, n+1)):
    print 'NO'
else:
    print 'YES'

s=raw_input().split()
n=int(s[0])/2
x=int(s[1])
y=int(s[2])

if (x==n or x==n+1) and (y==n or y==n+1):
	print 'NO'
else:
	print 'YES'

In=raw_input().split(" ")
(n,x,y)=[int(c) for c in In]
n/=2
if ( (x==n) or (x==n+1) ) and ( (y==n) or (y==n+1) ) :
    print "NO"
else:
    print "YES"

input_data = raw_input()

n,x,y = input_data.split()
n = int(n)
x = int(x)
y = int(y)

flag = False
if x == n/2 and y == n/2:
    flag = True
if x == (n/2  +1 ) and y == n/2:
    flag = True
if x == (n/2  +1 ) and y == (n/2+1):
    flag = True
if x == (n/2 ) and y == (n/2+1):
    flag = True
if flag:
    print "NO"
else:
    print "YES"

a,b,c=map(int,input().split(' '))
if (b==a//2 or b==a//2+1 )and( c==a//2 or c==a//2+1):
    print("NO")
else:
    print("YES")

s = raw_input().split(" ")
n = int(s[0])/2
x = int(s[1])
y = int(s[2])

if n<=x<=n+1 and n<=y<=n+1:
  print "NO"
else:
  print "YES"

#def gcd(a,b):
#   while b > 0: a,b = b, a%b
#   return a
#def lcm(a, b):
#   return a*b/gcd(a,b)

#T = input()
n, x, y = map(int, raw_input().split())
n = n/2
if (x == n or x == n+1) and (y == n or y == n+1):
    print "NO"
else:
    print "YES"

#data = map(int, raw_input().split())
#data2 = [ map(int, raw_input().split()) for i in xrange(T)]

n, x, y = map(int, input().split())
p = [n // 2, n // 2 + 1]
if x in p and y in p:
    print('NO')
else:
    print('YES')

n,x,y=map(int,input().split())
if min(x,y)>=n//2 and max(x,y)<=n//2 + 1:
    print('NO')
else:
    print('YES')

if __name__ == "__main__":
    A = map(int,raw_input().split(" "))
    N = A[0]/2
    x = A[1]
    y = A[2]
    if (x == N or x == N + 1) and (y == N or y == N + 1):
        print "NO"
    else:
        print "YES"

k=input().split(" ")
n=int(k[0])
x=int(k[1])
y=int(k[2])
n/=2
if (x==n or x==n+1)and(y==n or y==n+1):
    print("NO")
else:
    print("YES")

n, x, y = map(int, raw_input().split())
n /= 2

if (n == x or n + 1 == x) and (n == y or n + 1 == y):
    print 'NO'
else:
    print 'YES'

n, x, y = map(int, raw_input().split())
print "NO" if n / 2 <= min(x, y) and max(x, y) <= n / 2 + 1 else "YES"

from sys import stdin, stdout

(n2, x, y) = [int(x) for x in stdin.readline().strip().split()]

print('YES' if x != n2//2 and x != n2//2+1 or y != n2//2 and y != n2//2+1 else 'NO' )

(tn,tx,ty) = raw_input().split()
n,x,y = int(tn),int(tx),int(ty)

mid = n / 2
if (x,y) in [(mid,mid+1),(mid,mid),(mid+1,mid),(mid+1,mid+1)]:
    print 'NO'
else:
    print 'YES'

s=input().split();n,x,y=int(s[0])//2,int(s[1]),int(s[2])
if x==n and y==n:
    print('NO')
elif x==n+1 and y==n:
    print('NO')
elif x==n+1 and y==n+1:
    print('NO')
elif x==n and y==n+1:
    print('NO')
else:
    print('YES')

args = raw_input().split()
_2n = int(args[0])
x = int(args[1])
y = int(args[2])

pair = (_2n/2, _2n/2 + 1)
yes = x not in pair or y not in pair
if yes:
    print "YES"
else:
    print "NO"

n, x, y = map(int, raw_input().split())

if (n/2 == x or n/2+1 == x) and (n/2 == y or n/2+1 == y) :
    print "NO"
else:
    print "YES"

n,x,y=map(int,input().split())
n//=2
print("NO" if (x==n or x==n+1) and (y==n or y==n+1) else "YES")

n, x, y = map(int, input().split());
if((x == n // 2 or x == n // 2 + 1) and (y == n // 2 or y == n // 2 + 1)):
    print('NO')
else:
    print('YES')

import sys
def read_values():
  return map(int,raw_input().split())

n,x,y=read_values() ; n/=2
if n<=x<=n+1 and n<=y<=n+1:
  print 'NO'
else:
  print 'YES'

n,x,y = map(int,input().split())

if x in (n//2, n//2+1) and y in (n//2, n//2+1):
    print('NO')
else:
    print('YES')

n,x,y=map(int,input().split())
a=[(n//2),(n//2)+1]
print(['YES','NO'][x in a and y in a])

n, x, y = map(int, raw_input().split())
print 'NO' if ((x == n / 2 or x == n / 2 + 1) and (y == n / 2 or y == n / 2 + 1)) else 'YES'

n,x,y=map(int,raw_input().split())
mid=n/2
a=[[mid,mid],[mid+1,mid],[mid,mid+1],[mid+1,mid+1]]
if [x,y] in a:
	print "NO"
else:
	print "YES"

line=raw_input().split()
n=int(line[0])
x=int(line[1])
y=int(line[2])
if (x==n/2 or x==n/2+1) and (y==n/2 or y==n/2+1):
    print 'NO'
else:
    print 'YES'

n,x,y=map(int,raw_input().split())
n/=2
print"NO"if (x==n or x==n+1)and(y==n or y==n+1)else"YES"

n,x,y = map(int,raw_input().split())
n /= 2;
if (x != n and x != n+1) or (y != n and y != n+1):
    print "YES"
else:
    print "NO"

n, a, b = map(int,input().split())
t1, t2 = n//2, (n//2)+1
if (a==t1 and b==t1) or (a==t1 and b==t2) or (a==t2 and b==t1) or (a==t2 and b==t2):
        print('NO')
else:
    print('YES')

n, x, y = map(int, input().split())
if y == n // 2 or y == n // 2 + 1:
    if x == n // 2 or x == n // 2 + 1:
        print("NO")
    else:
        print("YES")
else:
    print("YES")

n,x,y=map(int,input().split())
p=int(n/2)+2
if n==2:
    print('NO')
elif n%2==0 and y in range(int(n/2),p) and x not in range(int(n/2),p):
    print('YES')
elif n%2==0 and x in range(int(n/2),p) and y not in range(int(n/2),p):
    print('YES')
elif n%2==0 and (x not in range(int(n/2),p) or y not in range(int(n/2),p)):
    print('YES')
else:
    print('NO')

n,x,y=[int(i) for i in input().split()]
if y!=n/2 and y!=n/2+1: print("YES")
else:
    if x!=n/2 and x!=n/2+1: print("YES")
    else: print("NO")

n, x, y = map(int, input().split())
n //= 2
print('NO' if n <= x <= n + 1 and n <= y <= n + 1 else 'YES')

n,x,y=[int(x) for x in input().split()]
flag=0
if x == n//2 or x == n//2+1:
    flag += 1
if y == n//2 or y == n//2+1:
    flag += 1
if flag == 2:
    print('NO')
else:
    print('YES')

n,x,y = map(int, input().split());
n /= 2;
print(['YES','NO'][(x == n or x == n + 1) and (y == n or y == n + 1)]);

n,x,y=map(int,input().split())
n//=2
if (n==x or n==x-1) and (n==y or n==y-1):
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())
if ((x==n/2 or  x==n/2+1) and (y==((n/2)) or y==((n/2)+1))):
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())
if min(x,y)>=n//2 and max(x,y)<=n//2 + 1:
    exit(print('NO'))
else:
    exit(print('YES'))

n,x,y=map(int,input().split())
n=n//2
if (x==n and y==n) or (x==n+1 and y==n) or (x==n and y==n+1) or (x==n+1 and y==n+1):
	print('NO')
else:
	print('YES')

x,y,z = [int(x) for x in input("").split()]

n= x/2

if ((y == n or y == n + 1) and (z == n or z == n + 1)):
    print("NO")
else:
    print("YES")

from sys import setrecursionlimit
setrecursionlimit(1000000000)

def main():
    a, b, c=[int(i) for i in input().split()]
    if ((a//2==b) and (a//2==c)) or ((a//2==b-1) and (a//2==c)) or ((a//2==b) and (a//2==c-1)) or ((a//2==b-1) and (a//2==c-1)):
        print("NO")
        return 0
    print("YES")

main()

_2n,x,y=list(map(int,input().split()))
n=_2n/2
if (x==n or x==n+1) and (y==n or y==n+1): print('NO')
else: print('YES')

n2, x, y = [int(i) for i in input().split()]

middle = n2//2

if (x == middle+1 or x == middle) and (y == middle+1 or y == middle):
    print("NO")
else:
    print("YES")

n , x, y = [int(x) for x in raw_input().split()]
if (x == n/2 or x == n/2 + 1) and (y == n/2 or y == n/2 + 1):
    print "NO"
else:
    print "YES"

n,x,y = map(int,raw_input().strip().split())
n /= 2
if (x,y) in ((n,n),(n+1,n),(n,n+1),(n+1,n+1)):
    print 'NO'
else:
    print 'YES'

n, x, y = map(int, raw_input().split())
f = lambda x : x in (n / 2, n / 2 + 1)
print 'NO' if f(x) and f(y) else 'YES'

L = map(int, raw_input().strip().split())
n = L[0]
x = L[1]
y = L[2]

if (x == n/2 or x == n/2 + 1) and (y == n/2 or y == n/2 + 1):
    print "NO"
else:
    print "YES"

n,x,y=map(int, raw_input().split())
n/=2
s=[n,n+1]
print "YNEOS"[x in s and y in s::2]

n,x,y=map(int, raw_input().split())
m=n/2
print "YNEOS"[x in [m,m+1] and y in [m,m+1]::2]

input = raw_input().split(' ')

n = int(input[0])/2
x = int(input[1])
y = int(input[2])

if  (x,y) == (n, n)     or \
    (x,y) == (n+1, n)   or \
    (x,y) == (n, n+1)   or \
    (x,y) == (n+1, n+1):
    print 'NO'
else:
    print 'YES'

n, x, y = tuple(int(x) for x in raw_input().strip().split(" "))

nn = n/2

if (x==nn and y==nn) or (x==nn and y==nn+1) or (x==nn+1 and y==nn) or (x==nn+1
        and y==nn+1):
    print "NO"
else:
    print "YES"

n, x, y = map(int, raw_input().split())
print ['YES', 'NO'][{x, y} <= {n / 2, n / 2 + 1}]

def main(n, x, y):
    if (x == n and y == n):
        return "NO"
    if (x == n and y == n+1):
        return "NO"
    if (x == n+1 and y == n):
        return "NO"
    if (x == n+1 and y == n+1):
        return "NO"
    else:
        return "YES"

line = raw_input()
lst = line.split(" ")
n = int(lst[0])/2
x = int(lst[1])
y = int(lst[2])
print main(n, x, y)

import sys
L=raw_input()
L=L.split()
n=int(L[0])
x=int(L[1])
y=int(L[2])
n/=2
if (x>=n)&(x<=n+1)&(y>=n)&(y<=n+1):
    print "NO"
else:
    print "YES"

#-*- coding: utf-8 -*-

import sys
import re

write = sys.stdout.write

nab = sys.stdin.readline()
nab = nab.replace('\n','').split(" ")
n,a,b = int(nab[0]), int(nab[1]), int(nab[2])

n = n/2

if n==1:
    write("NO")
elif a!=n and a!=n+1:
    write("YES")
elif b>1 and b<2*n and n>=3 and b!=n and b!=n+1:
    write("YES")
elif (b==1 or b==2*n) and n>=2:
    write("YES")
else:
    write("NO")

n, x, y = map(int, raw_input().split(' '))

print not (x in (n/2,n/2+1) and y in (n/2,n/2+1)) and 'YES' or 'NO'

import sys
import itertools
import math

if __name__ == '__main__':
  splited = raw_input().rstrip().split(" ")
  n = int(splited[0])
  x = int(splited[1])
  y = int(splited[2])

  p = [(n / 2, n / 2), (n / 2 + 1, n / 2), (n / 2, n / 2 + 1), (n / 2 + 1, n / 2 + 1)]
  if (x, y) in p:
    print "NO"
  else:
    print "YES"

n,x,y=map(int,raw_input().split())
f=lambda x: x in [n/2,n/2+1]
print ['YES','NO'][f(x) and f(y)]

n, x, y = map(int, raw_input().split())
if x == n / 2 and y == n / 2 or x == n / 2 and y == n / 2 + 1 or x == n / 2 + 1 and y == n / 2 or x == n / 2 + 1 and y == n / 2 + 1:
    print 'NO'
else:
    print 'YES'

n,x,y = map(int, raw_input().split())
print "NO" if n/2 <= x <= n/2+1 and n/2 <= y <= n/2+1 else "YES"

n,x,y=map(int,raw_input().split())
n/=2
print"NO"if abs(x-n)<2 and abs(y-n)<2 else"YES"

n, a, b = map(int,input().split())
t1, t2 = n//2, (n//2)+1
if (a==t1 and b==t1) or (a==t1 and b==t2) or (a==t2 and b==t1) or (a==t2 and b==t2):
        print('NO')
else:
    print('Yes')

n,x,y=map(int,input().split())
n=n//2
if n==x or n==x-1 and n==y or n==y-1:
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())

if n==2:
    print('NO')
elif n%2==0 and (x not in range(int(n/2),n) or y not in range(int(n/2),n)):
        print('YES')
else:
    print('NO')

n,x,y=map(int,input().split())
p=int(n/2)+2
if n==2:
    print('NO')
elif n%2==0 and y in range(int(n/2),p) and x not in range(int(n/2),p):
    print('YES')
elif n%2==0 and x in range(int(n/2),p) and y not in range(int(n/2),p):
    print('YES')
else:
    print('NO')

n,x,y=map(int,input().split())
if n==2:
    print('NO')
elif n%2==0 and (x and y) not in range(int(n/2),n):
    print('YES')
else:
    print('NO')

n, x, y = map(int, input().split())

s = n//2

print('YES' if (x < s  or x > s + 1) and (y < s or y > s + 1) else 'NO')

#from  sys import stdin
#input=stdin.readline
#a = sorted([(n, i) for i, n in enumerate(map(int, input().split()))])
# from collections import Counter
# import sys
#s="abcdefghijklmnopqrstuvwxyz"
#n=int(input())
#n,k=map(int,input().split())
#arr=list(map(int,input().split()))
#arr=list(map(int,input().split()))
n,x,y=map(int,input().split())
if (x==n//2 or x==(n//2)+1) and (y==n or y==((n//2)+1)):
    print("NO")
else:
    print("YES")

#from  sys import stdin
#input=stdin.readline
#a = sorted([(n, i) for i, n in enumerate(map(int, input().split()))])
# from collections import Counter
# import sys
#s="abcdefghijklmnopqrstuvwxyz"
#n=int(input())
#n,k=map(int,input().split())
#arr=list(map(int,input().split()))
#arr=list(map(int,input().split()))
n,x,y=map(int,input().split())
if x==n//2 or x==(n//2)+1:
    if n>2:
        if y>1 and y<n:
            print("NO")

        else:
            print("YES")
    else:
        print("NO")
else:
    print("YES")

#from  sys import stdin
#input=stdin.readline
#a = sorted([(n, i) for i, n in enumerate(map(int, input().split()))])
# from collections import Counter
# import sys
#s="abcdefghijklmnopqrstuvwxyz"
#n=int(input())
#n,k=map(int,input().split())
#arr=list(map(int,input().split()))
#arr=list(map(int,input().split()))
n,x,y=map(int,input().split())
if x==n//2 or x==(n//2)+1 and y==n or y==(n//2)+1:
    print("NO")
else:
    print("YES")

#from  sys import stdin
#input=stdin.readline
#a = sorted([(n, i) for i, n in enumerate(map(int, input().split()))])
# from collections import Counter
# import sys
#s="abcdefghijklmnopqrstuvwxyz"
#n=int(input())
#n,k=map(int,input().split())
#arr=list(map(int,input().split()))
#arr=list(map(int,input().split()))
n,x,y=map(int,input().split())
if x==n//2 or x==(n//2)+1:
    if n>2:
        if y>1 and y<n:
            print("NO")
    else:
        print("NO")
else:
    print("YES")

#from  sys import stdin
#input=stdin.readline
#a = sorted([(n, i) for i, n in enumerate(map(int, input().split()))])
# from collections import Counter
# import sys
#s="abcdefghijklmnopqrstuvwxyz"
#n=int(input())
#n,k=map(int,input().split())
#arr=list(map(int,input().split()))
#arr=list(map(int,input().split()))
n,x,y=map(int,input().split())
if x==n//2 or x==n//2+1 and y>1 and y<2*n:
    print("NO")
else:
    print("YES")

#!/usr/bin/python2

if __name__ == "__main__":
    s = raw_input()
    l = s.split(' ')
    n, x, y = int(l[0]), int(l[1]), int(l[2])
    if n > 4: print "YES"
    elif n == 2: print "NO"
    elif n == 4:
        if 2 <= x <= 3 and 2 <= y <=3:
            print "NO"
        else : print "YES"

#!/usr/bin/python2

if __name__ == "__main__":
    s = raw_input()
    l = s.split(' ')
    n, x, y = int(l[0]), int(l[1]), int(l[2])
    if n > 4: print "YES1"
    elif n == 2: print "NO"
    elif n == 4:
        if 2 <= x <= 3 and 2 <= y <=3:
            print "NO"
        else : print "YES"

l=[int(x) for x in raw_input().split()]
print 'YES' if l[0]%(4*l[2])==0 and l[0]>=(2*l[1]) else 'NO'

n,x,y = map(int, raw_input().split())
if x>=n/2 and x<=n/2+1 and y>=n/2 and y<=n/2+1:
    print "YES"
else:
    print "NO"

n, x, y = map(int, raw_input().split())
print ['YES', 'NO'][{x, y} <= {n, n + 1}]

import sys
L=raw_input()
L=L.split()
n=int(L[0])
x=int(L[1])
y=int(L[2])

if ((x>=n)&(x<=n+1))|((y>=n)&(y<=n+1)):
    print "NO"
else:
    print "YES"

import sys
L=raw_input()
L=L.split()
n=int(L[0])
x=int(L[1])
y=int(L[2])

if (x>=n)&(x<=n+1)&(y>=n)&(y<=n+1):
    print "NO"
else:
    print "YES"

#-*- coding: utf-8 -*-

import sys
import re

write = sys.stdout.write

nab = sys.stdin.readline()
nab = nab.replace('\n','').split(" ")
n,a,b = int(nab[0]), int(nab[1]), int(nab[2])

n = n/2

if a!=n and a!=n+1:
    write("YES")
elif n==1:
    write("NO")
elif b>1 and b<2*n and 2*n>=6:
    write("YES")
else:
    write("NO")

#-*- coding: utf-8 -*-

import sys
import re

write = sys.stdout.write

nab = sys.stdin.readline()
nab = nab.replace('\n','').split(" ")
n,a,b = int(nab[0]), int(nab[1]), int(nab[2])

n = n/2

if n==1:
    write("NO")
elif a!=n and a!=n+1:
    write("YES")
elif b>1 and b<2*n and 2*n>=6:
    write("YES")
elif (b==1 or b==2*n) and 2*n>=4:
    write("YES")
else:
    write("NO")

n,x,y=map(int,raw_input().split())
f=lambda x: x in [n,n+1]
print ['YES','NO'][f(x) and f(y)]

n,a,b = map(int,raw_input().split())
n /= 2
if n==1 or ((a==n or a==n+1) and (b==n or b==n+1)):
    print 'YES'
else:
    print 'NO'

def main():
    n, x, y = map(int, raw_input().split())
    if n <= x <= n + 1 and n <= y <= n + 1:
        print "NO"
    else:
        print "YES"

main()

def main():
    n, x, y = map(int, raw_input().split())
    if n == 1:
        print "NO"
    elif n == 2:
        if not (2 <= x <= 3 or 2 <= y <= 3):
            print "YES"
        else:
            print "NO"
    elif n <= x <= n + 1 and n <= y <= n + 1:
        print "NO"
    else:
        print "YES"

main()

input_data = raw_input()

n,x,y = input_data.split()
n = int(n)
x = int(x)
y = int(y)

number_of_fields = 0
if x-1 >= 1 and y-1>=1:
    number_of_fields += 1
if y-1 >= 1:
    number_of_fields +=1
if y+1 <=n:
    number_of_fields +=1
if x-1 >=1:
    number_of_fields +=1
if x+1 <= n:
    number_of_fields +=1

if y-1 >=1 and x+1 <=n:
    number_of_fields +=1
if y+1 <=n and x+1 <=n:
    number_of_fields +=1
if y+1 <=n and x-1 >=1:
    number_of_fields +=1
number_of_fields +=1

if number_of_fields < (n*n)/2:
    print "YES"
else:
    print "NO"

input_data = raw_input()

n,x,y = input_data.split()
n = int(n)
x = int(x)
y = int(y)

number_of_fields = 0
if x-1 >= 1 and y-1>=1:
    number_of_fields += 1
if y-1 >= 1:
    number_of_fields +=1
if y+1 <=n:
    number_of_fields +=1
if x-1 >=1:
    number_of_fields +=1
if x+1 <= n:
    number_of_fields +=1

if y-1 >=1 and x+1 <=n:
    number_of_fields +=1
if y+1 <=n and x+1 <=n:
    number_of_fields +=1
if y+1 <=n and x-1 >=1:
    number_of_fields +=1
number_of_fields +=1

if number_of_fields <= (n*n)/2:
    print "YES"
else:
    print "NO"

import sys

if __name__ == "__main__":
	l=raw_input()
	l=int(l[0])
	if(l>2): print "YES"
	else: print "NO"

(n, x, y) = [int(i) for i in raw_input().split()]
if x == n / 2 and y == n / 2 or x == n / 2 and y + 1== n / 2 or x + 1 == n / 2 and y == n / 2 or x + 1 == n / 2 and y + 1 == n / 2:
	print "YES"
else:
	print "NO"

(n, x, y) = [int(i) for i in raw_input().split()]
if x == n / 2 or y == n / 2 or x + 1 == n / 2 or y + 1 == n / 2:
	print "YES"
else:
	print "NO"

line = raw_input()
(n, x, y) = map(int, line.split(' '))
n /= 2
if(-1 <= x - n <= 0 and -1 <= y - n <= 0):
    print 'YES'
else:
    print 'NO'

import sys

n2, x, y = map(int, raw_input().split())
D = [-1, 0, 1]
Sq = {}
for dx, dy in [(a, b) for a in D for b in D if (a, b) != (0, 0)]:
   print dx, dy
   i, j = x + dx, y + dy
   if (i < 1 or i > n2) or (j < 1 or j > n2):
      continue
   if (i, j) in Sq:
      if Sq[(i, j)] == -1:
         print "NO"
         sys.exit(0)
   else:
      Sq[(i, j)] = 1
      Sq[(n2 - i + 1, n2 - j + 1)] = -1

print "YES"

input = [int(x) for x in raw_input().split(' ')]
size = input[0]
x = input[1]
y = input[2]

sizeA = size / 2
sizeB = sizeA + 1

can_be_split = True

if sizeA == x:
    can_be_split = False
elif sizeB == y:
    can_be_split = False
elif sizeA == x:
    can_be_split = False
elif sizeA == y:
    can_be_split = False

if can_be_split == False:
    print "NO"
else:
    print "YES"

n,x,y=map(int,input().split())

if x==1:
	if y==1:
		if n>x:
			if (n**2)//2>=4:
				print("YES")
			else:
				print("NO")
		else:
			print("NO")
	elif y==n:
		if n>1:
			if (n**2)//2>=4:
				print("YES")
			else:
				print("NO")
		else:
			print("NO")
	else:
		if (n**2)//2>=6:
			print("YES")
		else:
			print("NO")
elif x==n:
	if y==1 or y==n:
		if n>1:
			if (n**2)//2>=4:
				print("YES")
			else:
				print("NO")
		else:
			print("NO")
	else:
		if (n**2)//2>=6:
			print("YES")
		else:
			print("NO")
else:
	if y==1 or y==n:
		if (n**2)//2>=6:
			print("YES")
		else:
			print("NO")
	else:
		if (n**2)//2>=9:
			print("YES")
		else:
			print("NO")

n,x,y=map(int,input().split())
if ((y==n/2 and x==n/2) or (y==((n/2)+1) and x==((n/2)+1))):
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())
if (y==n/2 or y==((n/2)+1)):
    print("NO")
else:
    print("YES")

x,y,z = [int(x) for x in input("").split()]

n= x/2

s= x*x
t=y*z

if(s!=t):
    if(y==n or z==n):
        print("NO")
    else:
        print("YES")
else:
    print("NO")

x,y,z = [int(x) for x in input("").split()]

n= x/2

if(y>=n or z>=n):
    print("NO")
else:
    print("YES")

def main():
  n, x, y = [int(i) / 2 for i in raw_input().split()]
  if n == x and n == y:
    print 'NO'
  else:
    print 'YES'

if __name__ == '__main__':
  main()

import math
from fractions import gcd
def inp():
    return int(raw_input())
def linp():
    return map(int, raw_input().split())
n, x, y = linp()
if n==2:
    print "NO"
else:
    print "YES"

#!/usr/bin/env python

n,x,y=[int(i) for i in raw_input().split(" ")]

if x>=n/2 and x<=n/2+1:
    if y>=n/2 and y<=n/2+1: print "NO"
else: print "YES"

def main(n, x, y):
    if (x == n and y == n):
        return "YES"
    if (x == n and y == n+1):
        return "YES"
    if (x == n+1 and y == n):
        return "YES"
    if (x == n+1 and y == n+1):
        return "YES"
    else:
        return "NO"

line = raw_input()
lst = line.split(" ")
n = int(lst[0])/2
x = int(lst[1])
y = int(lst[2])
print main(n, x, y)

n2, x, y = [int(_) for _ in raw_input().split(" ")]
n = n2/2
if n == 1:
  print "NO"
else:
  if x == n and y == n:
    print "NO"
  else:
    print "YES"

def rd():
	return raw_input()
def nums():
	return map(int, rd().split())
n, x, y = nums()
p = x,y
if p == (n,n) or p == (n+1,n) or p == (n+1,n+1) or p == (n,n+1):
	print 'NO'
else:
	print 'YES'

n, x, y = map(int, raw_input().split())
if (x, y) in ((n, n), (n+1, n), (n, n+1), (n+1, n+1)):
    print 'NO'
else:
    print 'YES'

s=raw_input().split()
n=int(s[0])
x=int(s[1])
y=int(s[2])

if (x==n or x==n+1) and (y==n or y==n+1):
	print 'NO'
else:
	print 'YES'

n,x,y = map(int,raw_input().split( ' ' ) )
if n >= 4:
    print 'YES'
else:
    print 'NO'

s = raw_input().split(" ")
n2 = int(s[0])
x = int(s[1])
y = int(s[2])

if n2<=2:
  print "NO"
elif n2<=4 and (2<=x<=3 and 2<=y<=3):
  print "NO"
else:
  print "YES"

n, x ,y = map(int, raw_input().split(' '))
msg = "NO"
if n / 2 != x and n / 2 + 1 != x:
    if n / 2 != y and n / 2 + 1 != y:
        msg = "YES"
print msg

(n, x, y) = map(int, raw_input().split(" "))
m = n // 2
if x == m - 1 and y == m - 1:
    print "NO"
elif x == m - 1 and y == m + 1:
    print "NO"
elif x == m + 1 and y == m + 1:
    print "NO"
elif x == m + 1 and y == m - 1:
    print "NO"
else:
    print "YES"

n,x,y=map(int,raw_input().split())

n/=2

if (x==n or x==n+1) and (y==n or y==n+1):  #midden dus niet spiegelbaar
    print 'N0'
else:
    print 'YES'

n,x,y= map(int,input().split())
n//=2
if(x>=n) and (y>=n):
    print('NO')
else:
    print("YES")

n,x,y=map(int,input().split())
if x==int(n/2) or x==int(n/2)+1 or y==int(n/2) or y==int(n/2)+1:
    print('NO')
else:
    print('YES')

a,b,c=map(int,input().split(' '))
if b==a//2 or b==a//2+1 or c==a//2 or c==a//2+1:
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())

if(n==2):
    print("NO")
else:
    print("YES")

n,x,y=map(int,input().split())
print(['NO',"YES"][x!=n/2 and x!=n/2+1 and y!=n/2 and y!=n/2+1])

s=input().split();n,x,y=int(s[0]),int(s[1]),int(s[2])
if x!=n and x!=n+1 and y!=n and y!=n+1:
    print('YES')
else:
    print('NO')

n,x,y=map(int,input().split())

d = { n//2, n//2+1 }

if x in d or y in d:
	print("NO")
else:
	print("YES")


n, m = map(int, raw_input().split())

print sum([b == n - (m-b*b)**2 for b in range(n+1) if m >= b**2])

import fileinput as f
import math

for line in f.input():
    if f.lineno() == 1:
        [n, m] = map(int, line.split())

a0 = 0
temp = int(math.sqrt(n))
if temp < m:
    af = temp
else:
    af = m

count = 0

def isint(x):
    return True if x - int(x) == 0 else False

for ai in range(a0, af+1):
    b = math.sqrt(m - ai)
    if isint(b):
        a = math.sqrt(n - b)
        if isint(a):
            count += 1

print count

# DON'T USE PYTHON FOR RECURSION
# TRY PYPY
import math
import operator
import sys
from collections import Counter, defaultdict
from math import ceil, floor, pi, sin, sqrt
from sys import exit, stdin, stdout

def main():
    # stdin = open('.in')
    n, m = map(int, stdin.readline().strip().split(' '))
    ans = 0
    for a in range(1001):
        for b in range(1001):
            ans += a * a + b == n and a + b * b == m
    print ans

main()

a = [int(i) for i in raw_input().split(' ')]
res = 0
for i in range(max(a[0],a[1])+1):
               for j in range(max(a[0],a[1])+1):
                              if (i**2 + j == a[0]) and (j**2 + i == a[1]):
                                  res +=1
print(res)

n, m = [int(e) for e in (input().split())]
ans = 0

for a in range (int(n**0.5)+1):
        b = n - pow(a, 2)
        if b >= 0 and a + pow(b, 2) == m:
            ans += 1
print (ans)

#!/usr/bin/python

def ir():
    return int(raw_input())

def ia():
    line = raw_input()
    line = line.split()
    return map(int, line)

n, m = ia()

ans = 0
for a in range(1005):
    for b in range(1005):
        if a*a + b==n and a + b*b==m:
            ans = ans + 1

print ans

n, m = [int(e) for e in (input().split())]
ans = 0

for a in range (33):
        b = n - a**2
        if a + (n-a**2)**2 == m and b >= 0:
            ans += 1
print (ans)

t=raw_input()
t=t.split()
count=0
for a in range(0,1001):
    for b in range(0,1001):
        if (a**2)+b==int(t[0]):
            if a+(b**2)==int(t[1]):
                count+=1
print count

from sys import stdin

line = stdin.readline().split()
n = int(line[0])
m = int(line[1])
pairs = 0

for a in range(0, 32):
    for b in range(0, 32):
        if (a*a + b == n) and (a + b*b == m):
            pairs += 1

print pairs

n, m = map(int, input().split())
c = 0
for a in range(n+1):
    for b in range(n+1):
        if a * a + b == n and a+b*b==m:
            # print(a,b, a*a+b)
            c += 1
print(c)

n,m = map(int, raw_input().split())
z = max(n,m)
cnt = 0
for a in xrange(z+1):
    b = n - a**2
    if b>=0 and a + b**2 == m:
        cnt+=1
print cnt

n, m = map(int, raw_input().split())
print sum([1 for i in xrange(m+1) if i*i<=m and (m-i*i)**2+i == n])

flag=int()
flag=0
n,m = map(int,input().split())
for i in range(n+1):
        for j in range(m+1):
                if i*i+j==n and i+j*j==m:
                        flag=flag+1
print(flag)

import sys

delers=[]

t=[int(x) for x in sys.stdin.readline().split()]

n,m=t[0],t[1]

result=0

for a in range(n+1):
    for b in range(m+1):
        if a*a+b==n and b*b+a==m:
            result+=1

print result

n,m = map(int,raw_input().split())
c = 0
for i in xrange(n+ 1):
    for j in xrange(m+ 1):
        if i*i + j == n and i + j*j == m:
            c += 1

print(c)

s=raw_input()
n,m=s.split(' ')
n,m=int(n),int(m)
q=0
for i in xrange(0,101):
    for y in xrange(0,101):
        if i**2+y==n and i+y**2==m:
            q+=1
print(q)

import math
n,m=map(int,input().split())
k=int(max(math.sqrt(n),math.sqrt(m)))
c=0
for i in range(k+1):
    for j in range(k+1):
        if(i*i+j == n and j*j+i==m):
            c+=1
print(c)

import math as m
n,o=map(int,input().split())
count=0
if n>o:
    a=m.floor(m.sqrt(n))
    for i in range(a+1):
        b= n-pow(i,2)
        if i+pow(b,2)==o:
           count+=1
else:
    b=m.floor(m.sqrt(o))
    for i in range(b+1):
        a=o-pow(i,2)
        if pow(a,2)+i==n:
            count+=1
print(count)

n, m = map(int, input().split())
highest = 0
count = 0

if n > m:
    highest = n
else:
    highest = m

for i in range(0, highest + 1):
    if i**2 + n-i**2 == n and i + (n-i**2)**2 == m and n-i**2 >=0:
        count += 1

print(count)

def r(): return raw_input().strip()
def ri(): return int(r().strip())
def riv(): return map(int, r().split())

from math import sqrt

def main():
    n,m = riv()
    count = 0
    for a in range(int(sqrt(n))+1):
        b = n - (a**2)
        if b >= 0 and b**2 + a == m:
            count += 1

    print count

if __name__ == "__main__":
    main()

###Codeforces problem 456A###

n, m = map(int, raw_input().split())

ans = 0
for a in range(32):
    b = n - a * a
    if (a + b * b) == m and b >= 0:
        ans += 1

print ans

n, m = map(int, input().split())
if (m + n) < 10:
    x = (m + n) ** 2
else:
    x = max(n, m)
a = 0
b = 0
count = 0
for i in list(range(x)):
    for j in list(range(x)):
        if a ** 2 + b == n and a + b ** 2 == m:
            count += 1
            b += 1
        else:
            b += 1
    a += 1
    b = 0
print(count)

m,n=map(int,raw_input().split(" "))
a=count=0
while a<=m:
    if (a+pow(a,4)+n*n-2*n*a*a)==m:
        if n-a*a>=0:
            count+=1
    a+=1
print count

n,m=list(map(int,input().split()))
count=a=0
while a*a<=n:
    b=0
    while b*b<=m:
        if a*a+b==n and a+b*b==m:
            count+=1
        b+=1
    a+=1
print(count)

import sys
import math

n, m = [int(x) for x in (sys.stdin.readline()).split()]

if(n > 992 and m > 992):
    print(0)
    exit()

if(n >= m):
    k = int(math.sqrt(n))
    t = n - (k ** 2)

    res = 1
    if((t ** 2) + k == (t) + (k ** 2) and t != k):
        res += 1

    if((t ** 2) + k == m):
        print(res)
    else:
        print(0)
elif(m > n):
    k = int(math.sqrt(m))
    t = m - (k ** 2)

    if((t ** 2) + k == n):
        print(1)
    else:
        print(0)

(m,n) = map(int, raw_input().split())
x = m if m>n else n
print sum(((a*a)+b == n) and (a + (b*b) == m) for a in range(x+1) for b in range(x+1))

n, m = map(int, raw_input().split())

total = 0
for a in range(n+1):

	b = n - a**2
	if b < 0:
		break

	if a + b**2 == m:
		total += 1

print total

n,m=(map(int,input().split()))
ans=0
for i in range(32):
    for j in range(32):
        if i**2+j==n and i+j**2==m:
            ans+=1
        #print(i,j)
print(ans)

n,m = map(int, raw_input().split())
print sum([1 for a in range(n+1) if n >= a**2 and m == a + (a**2 - n)**2])

#!/usr/bin/env python
# coding: utf-8

# In[204]:

# # n = int(input())
# # line = list(map(int, input().split()))
# # line = list(str(input()))

# In[406]:

line = list(map(int, input().split()))

# In[407]:

m, n = line[0], line[1]
sum_val = m + n
n_pair = 0

for i in range(sum_val//2 + 1):
    for j in range(sum_val//2 +1):
        equ1 = i**2 + j
        equ2 = i + j**2
        if equ1 == m and equ2 == n:
            n_pair += 1

print(n_pair)

# In[375]:

n, m = [int(x) for x in input().split()]
count = 0
mn = min(n, m)
for a in range(0, mn + 1):
    for b in range(0, mn + 1):
        if (a * a + b == n) and (a + b * b == m):
            count += 1
print(count)

n, m = [int(x) for x in input().split()]
count = 0
mn = min(n, m)
for a in range(0, 1000):
    for b in range(0, 1000):
        if (a * a + b == n) and (a + b * b == m):
            count += 1
print(count)

n,m=map(int,raw_input().split())
print sum([i==n-(m-i*i)**2 for i in range(n+1) if m>=i*i])

n, m = list(map(int, input().split()))
min = min(n, m)
a = b = catch = 0

while a < min and b < min:
    a = a + 1
    if a ** 2 + b == n and a + b ** 2 == m:
        catch = 1
    elif a == min:
        b = b + 1
        if a == b == min:
            a = b
        else:
            a = 0

if n == int(1) and m == int(1):
    catch = 2
print(catch)

n, m = map(int, input().split())
count = 0
for i in range(1001):
    for j in range(1001):
        if i**2+j == n and i+j**2 == m:
            count+=1
print(count)

#!/usr/bin/env python
# http://acm.zhihua-lai.com

n, m = map(int, raw_input().split(' '))

x = 0
for a in xrange(0, int(n ** 0.5) + 1):
    b = n - a * a
    if a + b * b == m:
        x += 1

print x

s = input()

n,m = s.split()

a = int(n)**0.5

a = int(a)
temp = a

pair = 0
while a>=0:
    b = int(n) - a**2
    if int(a) + b**2 == int(m):
        pair +=1
        a = int(a) - 1
        continue
    else:
        a= int(a)-1
        continue

"""
flag = 0
while flag == 0 :
    temp += 1
    b = int(n) - temp**2
    if int(temp) + b**2 == int(m):
        pair += 1
        continue
    elif int(temp) + b**2 < int(m):
        continue
    else:
        flag = 1
"""
print (pair)

#!/usr/bin/python
from __future__ import division
from sys import stdout,stdin
from copy import copy,deepcopy
import math

def solve():
    n,m=map(int,raw_input().split())
    counter=0
    for a in xrange(int(math.ceil(1000**0.5))+1):
        for b in xrange(int(math.ceil(1000**0.5))+1):
            #if a*b+1==(n/m)*b:
            #if a+(b/a)==(n/a) and (a/b)+b==(m/b):
            if a**2+b==n and a+b**2==m:
                counter+=1
    return counter

print solve()

n , m = map(int , input().split())
cnt = 0

for i in range(min(n , m) + 1):
    for j in range(min(n,m) + 1):
        if (i * i) + j == n and (j * j) + i == m:
            cnt += 1
print(cnt)

ans = 0
n, m = map(int, input().split())
for i in range(n+1):
    for j in range(m+1):
        if (i*i+j) == n and (j*j+i)== m :
            ans+=1
print ("%d" % ans)

import bisect
from collections import defaultdict
from collections import deque
import math
import re

def ni():
    return int(raw_input())

def nis():
    return map(int, raw_input().split())

def si():
    return raw_input()

def sis():
    return raw_input().split()

n, m = nis()

ans = 0
for a in range(0, int(math.ceil(math.sqrt(n))) + 1):
    for b in range(0, int(math.ceil(math.sqrt(m))) + 1):
        if a** 2 + b == n and a + b **2 == m:
            ans += 1

print ans

N,M=map(int,input().split())
ans=0
if N>=M:
    for i in range(N+1):
        j=N-(i**2)
        if i+(j**2)==M and j>=0:
            ans+=1
else:
    for i in range(M+1):
        j=M-(i**2)
        if i+(j**2)==N and j>=0:
            ans+=1

print(ans)

n,m = map(int,raw_input().split())
count = 0
for i in range(1001):
    if (n - i*i) >= 0  and (m - i) == (n - i*i)*(n - i*i):
        count += 1
print count

t = input().split()
n = int(t[0])
m = int(t[1])

count = 0

for a in range(1001):
    for b in range(1001):
        if a**2 + b == n and b**2 + a == m:
            count += 1

print(count)

n,m = map(int,raw_input().split())
ans=0
for i in range(2000):
	for j in range(2000):
		if i*i + j == n and i + j*j == m: ans+=1
print ans

n,m=map(int,input().split())
c=0
for i in range(0,1001):
     for j in range(0,1001):
          if i*i+j==n and i+j*j==m:
                   c=c+1
print(c)

n, m = list(map(int, input().split()))
count = 0
a, b = 0, 0
while a ** 2 <= n:
    b = n - a ** 2
    if a ** 2 + b == n and a + b ** 2 == m:
        count += 1
        a += 1
    else:
        a += 1
print(count)

n, m = map(int, input().split())
ans = 0
for a in range(n + 1):
    for b in range(n + 1):
        if a * a + b == n:
            if a + b * b == m:
                ans += 1
print(ans)

n, m = map(int, input().split())
ans = 0
for a in range(n + 1):
    for b in range(n + 1):
        ans += (a * a + b == n) & (a + b * b == m)
print(ans)

inputs = raw_input().split(" ");
n = int(inputs[0]);
m = int(inputs[1]);
cnt = 0;
for i in range(1001):
	for j in range(1001):
		if ((i * i) + j) == n and (i  + (j *j) ) == m : cnt += 1;

print cnt;

n,m=map(int,input().split())
r=range(32)
print(sum(a*a+b-n==a+b*b-m==0 for a in r for b in r))

n,m= list(map(int,input().split()))
count = 0
for i in range(max(n,m)+1):
    for j in range(max(n,m)+1):
        if ((i*i)+j == n) and (i+(j*j) == m):
            count += 1
print(count)

def form(a, b, n, m):
    if((a**2)+b == n and a+(b**2)==m):
        return True
    else:
        return False
inp = list(map(int,input().split()))
n = inp[0]
m = inp[1]
smal = 0
big = 0
count = 0
if(n > m):
    smal = m
    big = n
else:
    smal = n
    big = m
for a in range(0, big+1):
    for b in range(0, big+1):
        if(form(a, b, n, m)):
            count += 1
print(count)

a = sorted(list(map(int, input().split())))
counter = 0
for i in range(int(a[0] ** .5) + 1):
    if (a[0] - i ** 2) ** 2 + i == a[1]:
        counter += 1
print(counter)

n, m = map(int, input().split())
count = 0

for a in range(0, max(n, m) + 1):
    for b in range(0, max(n, m) + 1):
        if a ** 2 + b == n and a + b ** 2 == m:
            count += 1
print(count)

n, m = map(int, input().split())
count = 0
for i in range(max(n, m) + 1):
    for j in range(max(n, m) + 1):
        if i * i + j == n and i + j * j == m:
            count += 1
print(count)

numbers=[int(n) for n in input().split()]
mx,mn=max(numbers),min(numbers)
pair=0
for i in range(0,int(pow(mx,0.5))+1):
    for q in range(0,mx-(i*i)+1):
        if i*i+q==mx and i+q*q==mn:
            pair+=1
print(pair)

n,m=map(int,input().split())
cnt=0
a,b=0,0
n,m=max(m,n),min(m,n)
step=0
while step*step<=n:
    if step*step<=n:
        a=step
        step+=1
    b=n-a*a
    if (m-b*b)==a:
        cnt+=1
print(cnt)

#214A
[n,m] = list(map(int,input().split()))
s = 0
for i in range(1001):
    for j in range(1001):
        if i**2+j==n and i+j**2==m:
               s+=1
print(s)

n, m = map(int, input().split())
pairs = 0

for i in range(max(n,m)+1):
    for j in range(max(n,m)+1):
        if i**2 + j == n and j**2 + i == m:
            pairs += 1

print(pairs)

import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# import numpy as np
sys.setrecursionlimit(int(pow(10,6)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("out.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

# @lru_cache(None)
t=1
# t=int(input())
for _ in range(t):
    n,m=l()
    ans=0
    for a in range(1001):
        for b in range(1001):
            if a*a+b==n and b*b+a==m:
                ans+=1
    print(ans)

__author__ = 'Esfandiar'
from math import sqrt
n,m = map(int,input().split())
b = res = 0
nn=n
while n:
    yy=sqrt(n)
    if int(yy) == yy and yy+(b**2) == m:
        if nn ==m and yy!=b:
            res+=2
        else:
            res+=1
    b+=1
    n-=1
print(res)

def count(n, m):
    c = 0
    r = n
    if m < n:
        r = m
    a = 0
    while a <= r:
        b = n - a ** 2
        if b >= 0 and a + b ** 2 == m:
            c = c + 1
        a = a + 1
    return c

n, m = map(int, input().split())
count = count(n, m)
print(count)

count = 0
n,m = map(int, input().split())
for a in range(0,max(int(pow(n, 0.5)), m)+1):
    for b in range(0, max(int(pow(m, 0.5)), n)+1):
        if (pow(a,2)+b == n) and (pow(b,2) + a == m):
            count += 1
print(count)

n,m=list(map(int, input().split(' ')))
k = 0
for a in range(100):
    for b in range(100):
        if a**2+b == n and a + b**2 == m:
            k+=1
print(k)

n,m=map(int,input().split())
ans=0
for i in range(1001):
    for j in range(1001):
        if (i*i+j==n and i+j*j==m):
            ans+=1
print(ans)

n,m=map(int,input().split())
s=0
for b in range(m+1):
    for a in range(n+1):
        if((a**2+b ==n) and (a+b**2 ==m)):
            s=s+1
print(s)

n , m = map(int,input().split())
count = 0
for i in range(101):
    a = i
    aa = a * a
    b = n - aa
    if a + (b * b) == m and b >= 0:
        count += 1

print (count)

c=0
n,m=map(int,input().split())
p=max(m,n)
for i in range(p+1):
  if ((i*i+abs(n-(i*i)))==n) and ((i+abs(n-(i*i))*abs(n-(i*i)))==m):
    c=c+1
print(c)

n,m = map(int,input().split())
a = 0
for i in range(0, 1000):
    for j in range(0, 1000):
        if i * i + j == n and j * j + i == m:
            a = a + 1
print(a)

n, m = map(int,input().split())
c = []
for i in range(n+1):
	for j in range(m+1):
		if i**2 + j == n and i + j**2 == m:
			c.append(i)
			c.append(j)
if len(c) == 0:
	print(0)
else:
	print(len(c)//2)

import math
def main():
    n,m = map(int,input().split())
    c = 0
    for i in range(0,int(math.sqrt(n) + 1)):
        a = i
        b = n - a*a
        if b*b + a == m:
            c += 1
    print(c)

main()

n, m = map(int, input().split())
r, c = (max(n,m)+1)//2+1, 0
for a in range(r):
    for b in range(r):
        if a**2+b==n and a+b**2==m: c+=1
print(c)

import math
string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
solutions = 0
for x in range(int(math.sqrt(a)) + 1):
    y = a - x ** 2
    if x + y ** 2 == b:
        solutions += 1
print(solutions)

n, m = map(int, input().split())
ans = 0

l = []
a = int(n ** 0.5)
for i in range(a+1):
    c = n - i ** 2
    t = (i, c)
    l.append(t)

for j in l:
    if j[0] + j[1] ** 2 == m:
        ans += 1

print(ans)

import math

n,m=list(map(int,input().split()))
a=max(n,m)
b=min(n,m)
c=int(math.sqrt(a))
r=a-(c*c)
if a==1 and b==1:
	print("2")
elif r==0:
	print("1")
elif c+(r*r)==b:
	print("1")
else:
	print("0")

import math
n,m = map(int,input().split())
count=0
for i in range(int(math.sqrt(n))+1):
    for j in range(int(math.sqrt(m))+1):
        if (i*i)+j == n and i+(j*j) == m:
            count+=1
print(count)

n,m=map(int, input().strip().split())

res = 0

for a in range(0, 1000 ) :
	for b in range(0, 1000)   :
		if (a**2 + b == n) and (a + b**2 == m):
			res += 1
print(res )

n,m=map(int,input().split(" "))
s=0
for i in range(max(n,m)+1):
    for j in range(min(n,m)+1):
        if i**2+j==n and j**2+i==m:
            s+=1
print(s)

import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
    return(int(input()))

def inlist():
    return(list(map(int, input().split())))

def instr():
    s = input()
    return(list(s[:len(s)]))

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

n, m = invr()
c = 0
for i in range(n+1):
    for j in range(m+1):
        if i*i + j == n and i + j*j == m:
            c += 1
print(c)

n,m=[int(i)for i in input().split()]
c=0
i=0
while i*i <= n:
    b=n-(i*i)
    if i+(b*b)==m:
        c+=1
    i+=1
print(c)

import itertools
I = lambda : map(int, raw_input().split())

def main():
    n, m = I()
    print sum(a**2+b==n and a+b**2==m for a, b in itertools.product(range(1001), repeat=2))

if __name__ == '__main__':
    main()

import itertools
n,m = map(int,raw_input().split())
print sum(a**2+b==n and a+b**2==m for a,b in itertools.product(range(99),repeat=2))

import sys
import math

n,m = map(int,raw_input().split())

count = 0
k = max(n,m)
for i in range(k+1):
    for j in range(k+1):
        if (i**2+j)==n and (j**2+i)==m:
            count+=1

print(count)

n,m=map(int,raw_input().split())
r=range(32)
print(sum(a*a+b-n==a+b*b-m==0 for a in r for b in r))

n, m = map(int, raw_input().split())
print sum([a**2 + b == n and a + b**2 == m for a in xrange(n+1) for b in xrange(m+1)])

n, m = list(map(int, input().split()))
min = min(n, m)
a = b = catch = 0

while a < min and b < min:
    a = a + 1
    if a ** 2 + b == n and a + b ** 2 == m:
        catch = 1
        print(catch)
    elif a == min:
        b = b + 1
        if a == b == min:
            a = b
        else:
            a = 0

if catch == 0:
    print('0')

N,M=map(int,input().split())
ans=0
if N>=M:
    for i in range(1,N+1):
        j=N-(i**2)
        if i+(j**2)==M:
            ans+=1
else:
    for i in range(1,M+1):
        j=M-(i**2)
        if i+(j**2)==N:
            ans+=1

print(ans)

from itertools import combinations
x,y=map(int,input().split())
l=[i for i in range(1000)]
p=list(combinations(l,2))
c=0
for i in range(len(p)):
    a = []
    for j in range(1):
        if (p[i][j]**2 + p[i][j+1]==x and p[i][j] + p[i][j+1]**2==y) or (p[i][j]**2 + p[i][j+1]==y and p[i][j] + p[i][j+1]**2==x):
            a.append(p[i][j])
            a.append(p[i][j+1])
            c +=1
if c>0:
    print(c)
else:
    print(0)

lis = list(map(int,input().split()))
lis.sort()
if lis[0]**2 == lis[1]:
    print(1)
elif lis[0]*2==lis[1]:
    print(1)
else:
    print(0)

n, m = map(int, input().split())
count = 0
for i in range(1001):
    if n**2 - 2*n*i**2 + i**4 - m + i == 0 and (n - i**2) % 1 == 0:
        count += 1
print(count)

import math

n,m=list(map(int,input().split()))
a=max(n,m)
b=min(n,m)
c=int(math.sqrt(a))
r=a-(c*c)
if r==0:
	print("1")
elif c+(r*r)==b:
	print("1")
else:
	print("0")

n,m = map(int,input().split())
c = 0
for a in range(-35,35):
    for b in range(-35,35):
        if a**2 + b == n:
            if b**2 + a == m:
                c += 1
print(c)

import sys
import math

n,m = map(int,raw_input().split())

count = 0
k = max(n,m)
for b in range(k+1):
    if m>=b**2 and b== n - (m-b**b)**2:
        count+=1

print(count)

# bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# from math import *
# from itertools import *
# import random
n, m = map(int, input().split())
total_ = 0
for i in range(0, (n*n) + 1):
    b = n - i*i
    if b * b == m - i:
        total_ += 1
    else:
        continue
print(total_)

k = raw_input()
k = k.split()

n = int(k[0])
m = int(k[1])

ans = 0

for i in range(0, n+1):
	j = n - i**2
	if (i + j**2 == m):
		ans += 1

print ans

import  math
__author__ = 'EvgeniyVO1'

str = raw_input("input first number n=")

st = str.split(" ")

n = int(st[0])

m = int(st[1])

lim = int(math.sqrt(float(n)))

eq = []
count = 0
for i in range(0,lim):
    for j in range(0,m):
        if ((i*i+j == n) and (i+j*j == m)):
            count = count+1

print count

import math

def get_primes(prime_supr):

    is_prime = [0]*2 + [1]*prime_supr

    for i in range(2,int(math.sqrt(prime_supr)) + 1):
        if is_prime[i]:
            for j in range(i * i, prime_supr + 1, i):
                is_prime[j] = 0

    return is_prime

get_int = lambda: map(int, input().split())

n, m = get_int()

print([0, 1][m >= math.sqrt(n) and n >= math.sqrt(m)])

#!/usr/bin/python
from __future__ import division
from sys import stdout,stdin
from copy import copy,deepcopy
import math

def solve():
    n,m=map(int,raw_input().split())
    counter=0
    for a in xrange(n+1):
        for b in xrange(m+1):
            if a==0:
                if b==n and b**2==m:
                    counter+=1
            elif b==0:
                if a**2==n and a==m:
                    counter+=1
            #if b*a+b==(n/m)*b and a+(b*a)==(m/n)*a:
            elif a+(b/a)==(n/a) and (a/b)+b==(m/b):
                counter+=1
    return counter

print solve()

n,m=map(int,input().split())
c=0
for a in range(n):
	b=n-a*a
	if a+b*b==m:
		c+=1
print(c)

n,m = [int(x) for x in input().split()]

ans = 0
for a in range(max(n,m)):
    for b in range(max(n,m)):
        if a**2 + b == n and a + b**2 == m:
            ans += 1

print(ans)

def solved(n,m):
    ma = max(n,m)
    #print(ma)
    count = 0
    for i in range(ma):
        b = n-i*i
        if i + b*b == m:
            count += 1
    return count
if __name__ == '__main__':
    n,m = map(int,input().split())
    print(solved(n,m))

s = raw_input

n, m = map(int, s().split())

c = 0
for i in range(max(m, n)):
    for j in range(max(m, n)):
        if i**2+j == n and i+j**2==m:
            c+=1
print c

#!/usr/bin/env pypy
from __future__ import division, print_function
from collections import defaultdict, Counter, deque
from future_builtins import ascii, filter, hex, map, oct, zip
from itertools import imap as map, izip as zip, permutations, combinations, combinations_with_replacement,product
from __builtin__ import xrange as range
from math import ceil, factorial, log,tan,pi,cos,sin,radians
from _continuation import continulet
from cStringIO import StringIO
from io import IOBase
import __pypy__
from bisect import bisect, insort, bisect_left, bisect_right
from fractions import Fraction
from functools import reduce
from decimal import *
import string
import sys
import os
import re
inf = float('inf')
mod_ = int(1e9) + 7
mod = 998244353

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

def sieve(n):
    arr=[1]*n
    for i in range(2,int(n**0.5)+1):
        if arr[i]==1:
            for j in range(i,n,i):
                arr[j]=i
    return arr

def main():
    cnt=0
    n,m=list(map(int,input().split()))
    for i in range(1,1001):
        for j in range(1,1001):
            if i**2+j==n and i+j**2==m:
                cnt+=1

    print(cnt)

# region fastio

BUFSIZE = 8192

class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()

class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()

def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

n,m=map(int,input().split())
k=0
for i in range(max(n,m)):
    b=i
    a=(n-b)**0.5
    if m-b**2==a:
        k+=1
print(k)

n,m=map(int,raw_input().strip().split())
cou=0
for i in range(m):
	if (m-(i*i))**2==n-i:cou+=1
	if n==m and n!=1000:cou=2
print cou

n, m = raw_input().split()
n, m = int(n), int(m)
t = 0
for a in range(0, n+1) :
    b = n - a**2
    if b == int(b) and b**2 + a == m :
        t += 1
print t

(N, M) = [int(x) for x in input().split()]
count = 0
for a in range(max(N, M)):
    for b in range(max(N, M)):
        if a + (b ** 2) == M and (a**2) + b == N:
            count += 1

print(count)

from sys import stdin

line = stdin.readline().split()
m = line[0]
n = line[1]
pairs = 0

for a in range(0, 32):
    for b in range(0, 32):
        if (a**2 + b == n) and (a + b**2 == m):
            pairs += 1

print pairs

a, b=sorted(map(int, input().split()))
g=max(a, b)
f=min(a, b)
i=1
while(i**2<=b):
  i=i+1
h=i-1
x=b-h**2
cnt=0

if h**2+x==b and x**2+h==a:
  cnt+=1
  print(cnt)
elif (a==1 and b==1):
  print("2")
else:
  print("0")

#*+++++++++++++++++++++
# * Written By --------
# * Boddapati Mahesh  **
# * IIIT Hyderabad *****
# */
n,m=map(int,raw_input().split())
count=0
for i in range(0,1001):
    for j in range(0,1001):
        if( i*i+j ==n and i+j*j==m):
            print i,j
            count+=1
print count

n,m=map(int,input().split())
count=0
a=0
b=0
while a**2+b!=n or a+b**2!=m:
    a+=1
    count+=1
    if a==32:
        a=0
        b+=1
    if a==31 and b==32:
        print(0)
        break
print(1)

t = input().split()
n = int(t[0])
m = int(t[1])

count = 0

for a in range(1,1001):
    for b in range(1,1001):
        if a**2 + b == n and b**2 + a == m:
            count += 1

print(count)

import math

n,m=list(map(int,input().split()))
a=max(n,m)
b=min(n,m)
c=int(math.sqrt(a))
r=a-(c*c)
if r==0:
	print("1")
elif c+(r*r)==b:
	print("1")
else:
	print("0")

# coding: utf-8
from math import sqrt

def tim_nghiem(n, so):
    nghiem = sqrt((n - so))
    nghiem_2 = int(nghiem)
    if nghiem == float(nghiem_2):
        return nghiem
    else:
        return None

if __name__ == '__main__':
    n, m = input().split(' ')
    n = int(n)
    m = int(m)
    mang_n = []
    for so_a in range(n + 1):
        if tim_nghiem(n, so_a):
            b = tim_nghiem(n, so_a)
            if tim_nghiem(m, b) is not None:
                a = tim_nghiem(m, b)
                if int(a) == int(so_a):
                    mang_n.append([so_a, b])
    print(len(mang_n))

n,m = map(int,raw_input().split())

count = 0
for a in range(max(n,m)):
    for b in range(max(n,m)):
        if a*a+b == n and a+b*b == m:
            count += 1

print count

#hello
c=0
n,m=map(int,input().split())
p=max(m,n)
for i in range(0,p+1):
  if (i*i+(n-(i*i)))==n and (i+(n-i)*(n-i))==m:
    c=c+1
print(c)

def solve(n, m):
    return sum(1 for b in range(n + 1)
                 for a in range(m + 1)
                 if a*a + b == n and b*b == m)

def main():
    n, m = list(map(int, input().split()))
    print(solve(n, m))

main()

import sys
import math

n, m = [int(x) for x in (sys.stdin.readline()).split()]

if(n > m):
    k = int(math.sqrt(n))
    t = n - (k ** 2)

    if((t ** 2) + k == m):
        print(1)
    else:
        print(0)
elif(m > n):
    k = int(math.sqrt(m))
    t = m - (k ** 2)

    if((t ** 2) + k == n):
        print(1)
    else:
        print(0)
else:
    print(2)

n, m = map(int, input().split())
p = [i for i in range(round(max(n, m) ** 0.5) + 1)]
count = 0
if n == m and n <= 2:
    print(2)
else:
    for i in p:
        for j in range(len(p) - 1):
            if p[j + 1] ** 2 + i == n and p[j + 1] + i ** 2 == m:
                count += 1
    print(count)

n, m = map(int, input().split())
if n + m > 0 and n * m == 0:
	print(0)
elif n + m == 0:
	print(1)
else:
	a = 0
	b = 0
	flag = 0
	while (a ** 2 + b < n or b ** 2 + a < m) and flag == 0:
		while a ** 2 + b < n or b ** 2 + a < m:
			a += 1
		if a **2 + b == n and b ** 2 + a == m:
			flag = 1
		else:
			a = 0
			b += 1
	if a ** 2 + b == n and b ** 2 + a == m:
		if n == m:
			print(2)
		else:
			print(1)
	else:
		print(0)

n, m = map(int, raw_input().split())
s = 0

for a in range(10000):
        b = n - a*a
        if b >= 0 and a + b * b == m:
                s += 1
                print a, b

print s

n,m = map(int,raw_input().split())
pairs = 0
for a in range (0,1001):
    b = n-(a*a)
    if (a + b*b == m):
        pairs += 1
print pairs

n, m = raw_input().split()
n, m = int(n), int(m)
t = 0
for a in range(0, n) :
    b = n - a**2
    if b == int(b) and b**2 + a == m :
        t += 1
print t

import math
lst=[]
z=list(map(int,input().split()))
for i in range(1,int(math.sqrt(max(z)))+1):
    x=z[0]-(i*i)
    if i+(x*x)==z[1]:
       if (i,x) not in lst:
          lst.append((i,x))
    v=z[1]-(i*i)
    if (v*v)+i==z[0]:
        if (v,i) not in lst:
            lst.append((v,i))
print(len(lst))

n,m=map(int,input().split())
cnt=0
a,b=0,0
while a+(b**2)!=m and (a**2)+b!=n:
    if cnt**cnt<n:
        cnt+=1
        a=cnt
    if cnt**cnt>=n:
        b=n-a**2
if m-b**2==a:
    print(1)
else:
    print(0)

import sys

[n,m] = [int(x) for x in sys.stdin.readline().split()]
squares = [x*x for x in range(32)]
singles = [x for x in range(32)]
set_singles = set(singles)
counter = 0
for x in range(len(squares)):
    b = n - squares[x]
    if b*b + singles[x] == m:
        counter += 1
print counter

# http://codeforces.com/problemset/problem/214/A
n, m  = map(int, input().split())
nm    = max(n,m)
count = 0

for a in range(0,nm-2):
	for b in range(a+1,nm):
		sum_a2b = a*a + b
		sum_ab2 = a + b*b

		if ((sum_a2b == n) and (sum_ab2 == m)) or ((sum_a2b == m) and (sum_ab2 == n)):
			count += 1

if (n == 1 and m == 1):
	print('2')
else:
	print(count)

n,m=map(int,input().split())
i=0
t=[]
s=[]
ch=0
while i**2<=n:
    t.append(i)
    i+=1
for i in range(len(t)):
    s.append(n-t[i]**2)
for i in range(len(t)):
    if t[i]+s[i]**2==m:
        ch+=1
print(s)

#!/usr/bin/env python
from sys import stdin
from math import modf

n, m = map(float, stdin.readline().split() )
count = 0
t = n
while(n):
    l = modf(n ** 0.5)
    if l[0] == 0:
        if l[1] + ((t-n) ** 2) == m:
            count += 1
    n -= 1
print count

def form(a, b, n, m):
    if((a**2)+b == n and a+(b**2)==m):
        return True
    else:
        return False
inp = list(map(int,input().split()))
n = inp[0]
m = inp[1]
smal = 0
big = 0
count = 0
if(n > m):
    smal = m
    big = n
else:
    smal = n
    big = m
for a in range(0, big):
    for b in range(0, big):
        if(form(a, b, n, m)):
            count += 1
print(count)

n, m = [int(x) for x in input().split(' ')]
a, b = 0, 0
res = 0
for i in range(0, m+n):
	for j in range(i, m+n):
		# print("pair({}, {})".format(i, j))
		first = (i ** 2) + j
		second = i + (j ** 2)

		if (first == n and second == m) or (first == m and second == n):
			res += 1

print(res)

from collections import defaultdict
n, m = [int(i) for i in input().split(" ")]
ct = 0
#dic = defaultdict(tuple)
'''for a in range(1001):
    b = n - a*a
    if b>=0 and a>=0 and a + b*b == m:
        ct+=1

if n==m:
    ct -= 1
print(ct)
'''
for a in range(1001):
    for b in range(a,1001):
        if a*a+b == n and a + b*b == m:
            ct+=1
print(ct)

n, m = raw_input().split()
n, m = int(n), int(m)
t = 0
for a in range(0, n+1) :
    b = n - a**2
    if b**2 + a == m and b > 0 :
        t += 1
print t

n,m = map(int, raw_input().split())
print sum([1 for a in range(n) if n >= a**2 and m == a + (a**2 - n)**2])

import sys, collections
input = sys.stdin.readline

n, m = map(int, input().split())

if n % m == 0 or m % n == 0:
    print(1)
else:
    print(0)

from collections import defaultdict
n, m = [int(i) for i in input().split(" ")]
ct = 0
#dic = defaultdict(tuple)
'''for a in range(1001):
    b = n - a*a
    if b>=0 and a>=0 and a + b*b == m:
        ct+=1

if n==m:
    ct -= 1
print(ct)
'''
done = []
for a in range(1001):
    b = n - a*a
    if a*a+b == n and a + b*b == m:
        ct+=1
if n==m:
    ct -=1
print(ct)

# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 18:48:38 2020

@author: Lenovo
"""

#https://codeforces.com/problemset/problem/214/A

def pair_equation():
    numbers = input().split()
    numbers = [int(i) for i in numbers]

    minimum = min(numbers[0],numbers[1])

    check = [0,0]
    output = 0
    for i in range(minimum):
        check[0] += 1
        check[1] = 0
        for i in range(minimum):
            if ((check[0])**2 + check[1]) == numbers[0] and (check[0] + (check[1])**2) == numbers[1]:
                output += 1
            check[1] += 1

    if output == 0:
        print(-1)
        return
    else:
        print(output)
        return

pair_equation()

__author__ = 'Esfandiar'
from math import sqrt
n,m = map(int,input().split())
b = res = 0

while n:
    yy=sqrt(n)
    if int(yy) == yy and yy+(b**2) == m:
        res+=1
    b+=1
    n-=1
print(res)

ans = 0
n, m = map(int, input().split())
for i in range(n):
    for j in range(m+1):
        if (i*i+j) == n and (j*j+i)== m :
            ans+=1
print ("%d" % ans)

n,m=map(int,input().split())
cnt=0
for i in range(n):
	if (n-i**2)**2+i==m:
		cnt+=1
print(cnt)

n, m = map(int, input().split())
count = 0
for i in range(1001):
    if n**2 - 2*n*i**2 + i**4 - m + i == 0 and (n - i**2) % 1 == 0:
        count += 1
print(count)

import math
n , m = map(int,input().split())
c = 0
l = []
for i in range(45):
    if i in l:
        continue
    a = i**2 + i
    e = m + n - a
    if e < 0:
        break
    d = 1 + 4*e
    v = (- 1 + math.sqrt(d))/2
    if v - int(v) == 0:
        if ((i**2 + v == m) or (v**2 + i == m)) and ((i**2 + v == n) or (v**2 + i == n)):
            l.append(v)
            c += 1
            continue
print(c)

import math
def main():
    n,m = map(int,input().split())
    c = 0
    for i in range(-n,int(math.sqrt(n) + 1)):
        a = i
        b = n - a*a
        if b*b + a == m:
            c += 1
    print(c)

main()

import math
numbers = input()
string = numbers.split(" ")
n=int(string[0])
m=int(string[1])

def is_perfect(number):
    num = number**0.5
    if num == int(num):
        print("Per")
    else:
        print("No")

lista=[]
listb=[]
i=1;
while(i<=math.sqrt(n)):
    b= n-(i**2)
    lista.append([i,b])
    i+=1
total=0

for i in lista:
    if(((i[1]**2)+i[0])==m):
        total+=1
print(total)

n,m = map(int,input().split())
c=0
for a in range(0,n):
    b1 = n-(a*a)
    b2 = (m-a)**(1/2)
    if b1 == b2:
        c += 1
    else:
        pass
print(c)

def solve(n, m):
    return sum(1 for b in range(n + 1)
                 for a in range(m + 1)
                 if a*a + b == n and b*b == m)

def main():
    n, m = list(map(int, input().split()))
    print(solve(n, m))

main()

#n=int(raw_input())
n,m=map(int,raw_input().split())
res=0
for i in range(0,n):
    b=n-i*i
    if b<0:
        break
    if i+b*b==m:
        res+=1
print res

n,m=[int(i) for i in input().split()]
count=0
for i in range(0,1001):
    for j in range(0,1001):
        if((i*i)+(j)==n and (i)+(j*j)==m and i!=j):
            count=count+1
print(count)

import math
p = input()
nums = p.split(" ")
n = int(nums[0])
m = int(nums[1])
count = 0
for a in range(0,max(n,m)+1):
    b = n - a*a
    if a + b*b == m:
        count = count + 1
print(count)

sum1 = 0
temp = map(int, raw_input().split())
n = temp[0]
m = temp[1]
end = min(n,m)
for i in range(end+1):
	b = n-i*i
	if(b<0):
		continue
	if((i+b*b)==m):
		print i
		sum1+=1
print sum1

n, m = map(int, input().split())
count = 0
for i in range(1001):
    if n**2 - 2*n*i**2 + i**4 - m + i == 0:
        count += 1
print(count)

import math
n,m=map(int,input().split())
a=math.sqrt(n)
a=math.floor(a)
b=math.sqrt(m-a)
if(math.floor(b)==math.ceil(b)):
    print(1)
else:
    print(0)

n,m=map(int,input().split())
count=0
a=0
b=0
while a**2+b!=n or a+b**2!=m:
    a+=1
    count+=1
    if a==32:
        a=0
        b+=1
    if a==31 and b==32:
        print(0)
        break
print(1)

n,m = map(int,input().split())
ans = 0
for a in range(min(n,m)+1):
    b = -(a**2 - n)
    if b ** 2 == m - a:
        ans += 1
print(ans)

n, m = [int(x) for x in input().split()]
count = 0
mn = min(n, m)
for a in range(0, mn):
    for b in range(0, mn):
        if (a * a + b == n) and (a + b * b == m):
            count += 1
print(count)

n,m = list(map(int,input().split()))
cc = 0
for a in range(1000):
    for b in range(1000):
        if a*a + b ==n and a + b*b==m or a*a + b ==m and a + b*b==n:
            cc = cc + 1
print(cc//2)

a = map(int,raw_input().split())
d = []
x = 0
while x<1020:
    if  x+ (a[0] - x**2)**2 ==a[1]:
        d.append(x)
    x+=1
print len(d)

n,m = map(int,raw_input().split())
print sum([int(a + (n-a**2)**2 == m) for a in xrange(1,1001)])

#tst problem A
"""
keys = dict()

def chkCond(a,b):
	if a**2+b == int(n) and b**2+a == int(m):
		keys[str(a**2+b) + "|" + str(b**2+a)]=1
		return 1
	return 0

def search(a,b):
	sLeft =0
	sRight=0
	if a**2 + b <= int(n) or b**2+a <= int(m):
		sLeft = search(a+1,b)
		sRight = search(a,b+1)
	return sLeft+sRight+chkCond(a,b)

search(0,0)
"""

I = lambda : map(int, raw_input().split())

def compute(a,n,m):
	l=a*(a*(a**2-2*int(n))+1)+int(n)**2
	if l == int(m):
		return 1
	return 0

def main():
	n, m = I()
	a=1
	ret=0
	while abs(int(n)-a**2) <= 1000:
		ret=ret+compute(a,n,m)
		a=a+1
	print ret# len(keys)

if __name__ == '__main__':
    main()

# coding: utf-8
from math import sqrt

def tim_nghiem(n, so):
    nghiem = sqrt((n - so))
    nghiem_2 = int(nghiem)
    if nghiem == float(nghiem_2):
        return nghiem
    else:
        return None

if __name__ == '__main__':
    n, m = input().split(' ')
    n = int(n)
    m = int(m)
    mang_n = []
    for so_a in range(n):
        if tim_nghiem(n, so_a):
            b = tim_nghiem(n, so_a)
            if tim_nghiem(m, b) is not None:
                a = tim_nghiem(m, b)
                if int(a) == int(so_a):
                    mang_n.append([so_a, b])
    print(len(mang_n))

n,m=map(int,input().split())
k=0
for a in range(1,max(n,m)+1):
    for b in range(1,max(n,m)+1):
        if a**2+b==n and a+b**2==m:
            k+=1
print(k)

s = raw_input

n, m = map(int, s().split())

c = 0
for i in range(max(m, n)):
    for j in range(max(m, n)):
        if i**2+j == n and i+j**2==m:
            c+=1
print c

from math import sqrt
n, m = [int(i) for i in input().split()]
s = n - m
l = []
for i in range(1, abs(s) + 1):
    if s % i == 0:
        l.append(i)
        l.append(-i)
c = 0
for i in l:
    t = i
    k = s // i
    a = (- k - t + 1) / 2
    b = a + t
    if a == int(a) and a*a + b == n and a >= 0 and b >= 0:
        c += 1
print(c)

# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 18:48:38 2020

@author: Lenovo
"""

#https://codeforces.com/problemset/problem/214/A

def pair_equation():
    numbers = input().split()
    numbers = [int(i) for i in numbers]

    minimum = min(numbers[0],numbers[1])

    check = [0,0]
    output = 0
    for i in range(minimum):
        check[0] += 1
        check[1] = 0
        for i in range(minimum):
            if ((check[0])**2 + check[1]) == numbers[0] and (check[0] + (check[1])**2) == numbers[1]:
                output += 1
            check[1] += 1

    print(output)
    return

pair_equation()

n=list(map(int, input().split()))

print(n)
p=0
for a in range(max(n[0]+1, n[1]+1)):
    for b in range(max(n[0]+1, n[1]+1)):
        if a*a+b==n[0] and b*b+a==n[1]:
            p+=1
            print(a,b)
print(p)

n,m=map(int,raw_input().split(' '))
cnt=0

def f(a,b,n):
     return a**2+b==n
def g(a,b,n):
     return a+b**2==m

for a in xrange(-100,100):
     for b in xrange(-100,100):
          if f(a,b,n) and g(a,b,n):
               cnt+=1
print cnt

# http://codeforces.com/problemset/problem/214/A
n, m  = map(int, input().split())
nm    = max(n,m)
count = 0

for b in range(n):
	for a in range(m):
		sum_a2b = a*a + b
		sum_ab2 = a + b*b

		if ((sum_a2b == n) and (sum_ab2 == m)):
			count += 1

print(count)

#b + n*a = d + m*c
#
#n = (d + m*c - b)/a

import math
def main():
    n,m = map(int,input().split())
    c = 0
    for i in range(-n,int(math.sqrt(n) + 1)):
        a = i
        b = n - a*a
        if b*b + a == m:
            c += 1
    print(c)

main()

lis = list(map(int,input().split()))
lis.sort()
if lis[0]**2 == lis[1]:
    print(1)
elif lis[0]*2==lis[1]:
    print(1)
else:
    print(0)

n, m = map(int, input().split())
a = -1
count = 0
while a * a < n:
    a += 1
    b = 0
    while b * b < m:
        if a*a+b==n and a+b*b == m:
            count +=1
            b += 1
        else:
            b += 1
print(count)

[n,m]=[int(x) for x in input().split()]
a=[]
count=0
for i in range(n+1):
    for j in range(m+1):
        if (i**2)+j==n and i+(j**2)==m:
            count=+1
print(count)

def generator(a,n):
    return a+(n-a**2)**2
s=input()
c=s.split()
n=int(c[0])
m=int(c[1])
a=1
contador=0
for a in range(500,0,-1):
    if(generator(a,n)==m):
        contador+=1
print(contador)

import math
n,m=map(int,input().split())
a=math.sqrt(n)
a=math.floor(a)
b=math.sqrt(m-a)
if(math.floor(b)==math.ceil(b)):
    print(1)
else:
    print(0)

n, m = map(int, input().split())

count = 0
for a in range(max(n, m)):
    for b in range(max(n, m)):
        if a ** 2 + b == n and a + b ** 2 == m:
            count += 1

print(count)

n, m = map(int, input().split())
o = 0
a = 0
b = 0
ia = -1
ib = -1
if n==1 and m==1:
    print(2)
else:
    while a ** 2 <= n:
        a += 1
        ia += 1
    while b ** 2 <= m:
        b += 1
        ib += 1
    if n > m:
        while ia > 0:
            if n - (ia ** 2) <= ib:
                o += 1
                ia -= 1
            else:
                ia -= 1
        print(o)
    else:
        while ib > 0:
            if m - (ib ** 2) <= ia:
                o += 1
                ib -= 1
            else:
                ib -= 1
        print(o)

n,m=list(map(int, input().split(' ')))
k = 0
b = 0
for i in range(1000):
    b = n-i**2
    if i+b**2 == m:
        k+=1
print(k)