n = int(input())
nums = list(map(int, input().split()))

def is_increasing_decreasing(nums):

	nums_dict = {}
	yes = "Yes"
	no = "No"

	for i in range(len(nums)):
		if nums[i] in nums_dict and nums_dict[nums[i]] == 2:
			return no
		elif nums[i] not in nums_dict:
			nums_dict[nums[i]] = 1
		else:
			nums_dict[nums[i]] += 1
	return yes, nums_dict

def run_and_print(yesno):

	yes = "Yes"
	no = "No"

	if is_increasing_decreasing(nums) == no:
		print(no)
		return

	elif yes in is_increasing_decreasing(nums):

		nums_incr_set = set(nums)
		nums_incr_lst = sorted(nums_incr_set)

		nums_dict = is_increasing_decreasing(nums)[1]

		new_nums = []

		for key, value in nums_dict.items():

			if key in nums_incr_set:
				value -= 1

			if value == 1:
				new_nums.append(key)

		nums_decr_lst = sorted(new_nums, reverse = True)

		print(yes)

		print(len(nums_incr_set))

		increasing = str(nums_incr_lst).replace(", ", " ")
		increasing = increasing.strip("[")
		increasing = increasing.strip("]")
		print(increasing)

		print(len(nums_decr_lst))

		decreasing = str(nums_decr_lst).replace(", ", " ")
		decreasing = decreasing.strip("[")
		decreasing = decreasing.strip("]")
		print(decreasing)


yesno = is_increasing_decreasing(nums)
run_and_print(yesno)