using System;
public class Program
{
public static void Main()
int N = Convert.ToInt32(Console.ReadLine());
int max, min, x;
max = min = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i < N; i++)
x = Convert.ToInt32(Console.ReadLine());
max = Math.Max(max, x);
min = Math.Min(min, x);
}
Console.Write(min < 30 ? max + " YES" : max + " NO");