program main implicit none integer*8::N,K,i,j,count,tmp integer*8,allocatable::D(:) data count/0/ read *,N,K allocate(D(N)) read *,D do i=1, N-1 do j=1, N-i if(D(j).gt.D(j+1)) then tmp = D(j+1) D(j+1) = D(j) D(j) = tmp count = count + 1 end if end do end do if(count .gt. K ) then print '("NO")' else if(MOD(count,2).eq.MOD(K,2)) then print '("YES")' else print '("NO")' end if end program main