# Arup Guha
# 12/15/2024
# Solution to Kattis Problem Jolly Jupers
# https://open.kattis.com/problems/jollyjumpers

# Solves the problem.
def solve(vals):

    # Frequency array.
    freq = [0]*n
    
    # Go through each consecutive pair.
    for i in range(len(vals)-1):

        # Get difference.
        diff = abs(vals[i]-vals[i+1])

        # Avoid array out of bounds.
        if diff < 1 or diff > n-1:
            return False

        # Update frequency array.
        freq[diff] += 1

        # Can't work.
        if freq[diff] > 1:
            return False

    # Have to be good if we get here.
    return True

# Get input.
while True:

    # How annoying...
    try:
        line = input()
    except EOFError:
        break

    # Just isolate list.
    vals = [int(x) for x in line.split()]
    n = vals[0]
    vals = vals[1:]

    # Ta da!
    if solve(vals):
        print("Jolly")
    else:
        print("Not jolly")


            
