List_Balance

Given an unsorted list, determine whether it is balanced.

Create a function solution that accepts a list and returns 1 if it is balanced and 0 otherwise.

Input 5 1 1 1 2 1

Where,

Second line represents the elements of the list.

Output 1