
b = input()
set1 = set()
set2 = set()
a = raw_input()
s = []
s = a.split(' ')
answer = ""
end = 0
k_pos = 0
k_neg = 0
pos = []
neg = []
pos_buf = ""
neg_buf = ""
if (b == 1):
    answer = "Yes"
    end = end + 1
    k_pos = 1
    pos = s
    k_neg = 0
    neg = []
elif (b == 2):
    answer = "Yes"
    end = end + 1
    k_pos = 1
    pos.append(s[0])
    k_neg = 1
    neg.append(s[1])
if (end !=0):
    print(answer)
    print(k_pos)
    for el in pos:
        pos_buf = pos_buf + el
    print(pos_buf)
    print (k_neg)
    for el in neg:
        neg_buf = neg_buf + el
    print(neg_buf)
else:
    for el in s :
        if(int(el) in set1):
            if (int(el) in set2):
                answer = "No"
                break
            else:
                set2.add(int(el))
        else:
            set1.add(int(el))

if(answer == "No"):
    print("No")
else:
    list_p = []
    list_n = []
    print("Yes")
    for el in set1:
        list_p.append(el)
    list_p.sort()
    print(len(list_p))
    bu8 = ""
    nu8 = 0
    for el in list_p:
        if(nu8==0):
            bu8 = bu8 + str(el)
        else:
            bu8 = bu8 + " " + str(el)
        nu8 = nu8 + 1
    print(bu8)

    for el in set2:
        list_n.append(el)
    list_n.sort(reverse=True)
    print(len(list_n))
    bu9 = ""
    nu9 = 0
    for el in list_n:
        if (nu9 == 0):
            bu9 = bu9 + str(el)
        else:
            bu9 = bu9 + " " + str(el)
        nu9 = nu9 + 1
    print(bu9)




