#!/usr/bin/env python3 import operator n = int(input()) x = sorted(map(int,input().split())) print(['NO', 'YES'][len(set(x)) == n and len(set(map(operator.sub, x, x[1:]))) == 1])