b = str(input())
i = 0
q = [ ]
for i in range(int(b.split(' ')[0])+1):
if i<=(int(b.split(' ')[0])):
z = int(b.split(' ')[i])
i+=1
q.append(int(z))
else:
break
q.remove(q[0])
q.sort()
if (q[-1]-q[0]==((int(b.split(' ')[0]))-1)):
print(str(q[0]),str(q[-1]),'yes')
else:
print(str(q[0]),str(q[-1]),'no')