import sys
N = int(input())
a_lis = [int(_) for _ in input().split()]

if set(a_lis) == {0}:
    print('Yes')
    sys.exit()
else:
    if len(a_lis) % 3 == 0:
        print('Yes')
    else:
        print('No')