aim_time = gets.to_i
study_times = gets.to_i
sum = 0
for i in 1..study_times
	a = Array.new(2)
	a = gets.split(nil)
	s_hour = a[1].to_i - a[0].to_i
	sum = sum + s_hour
end
if aim_time <= sum
	puts "OK"
else 
	puts aim_time - sum
end