def fibonacci(i):
	"""
	This function finds the ith number in the Fibonaci series, -1 otherwise.
	"""
	if i <= 0:
		return -1
		#Fixing the code to see if test cases go through
	if i <= 2:
		return 1

	prev = 1
	curr = 1

	for k in range(i-2):
		temp = curr
		curr += prev
		prev = temp

	return curr