// Arup Guha
// 12/15/2025
// Solution to Kattis Problem: Jolly Jumpers
// https://open.kattis.com/problems/jollyjumpers

import java.util.*;

public class jollyjumpers {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		// Annoying.
		while (stdin.hasNextLine()) {
		
			// Get next.
			String line = stdin.nextLine();
			StringTokenizer tok = new StringTokenizer(line);
			int n = Integer.parseInt(tok.nextToken());
			
			// Read vals.
			int[] vals = new int[n];
			for (int i=0; i<n; i++)
				vals[i] = Integer.parseInt(tok.nextToken());
				
			// Print accordingly.
			if (ok(vals))
				System.out.println("Jolly");
			else
				System.out.println("Not jolly");
		}
	}
	
	public static boolean ok(int[] seq) {
	
		int n = seq.length;
		int[] freq = new int[n];
		
		// Go through each consecutive difference.
		for (int i=0; i<n-1; i++) {
		
			// Get difference, if out of bounds get out.
			int diff = Math.abs(seq[i]-seq[i+1]);
			if (diff < 1 || diff > n-1)
				return false;
				
			// Update frequency; if too big get out.
			freq[diff]++;
			if (freq[diff] > 1) return false;
		}
		
		// Okay if we get here.
		return true;
	}
}