integer::N,i,kankaku,tmp integer,allocatable::x(:),memo(:) integer::min1,min2 read *, N allocate(x(N),memo(N)) read *, x min1 = MIN(x(1),x(2)) min2 = MAX(x(1),x(2)) if(min1.eq.min2) then print '(a)', "NO" return end if memo(1:2) = 0 do i=3,N memo(i) = 0 if(min1.gt.x(i)) then min2 = min1 min1 = x(i) else if(min2.gt.x(i)) then min2 = x(i) end if end do kankaku = min2 - min1 do i=1,N-1 if(MOD((x(i)-min1),kankaku).ne.0) then print '(a)', "NO" return end if tmp = (x(i)-min1)/kankaku if(memo(tmp).eq.1) then print '(a)', "NO" return end if memo(tmp) = 1 end do print '(a)', "YES" end program