Problem: A necklace can be described as a string of links ('-') and pearls ('o'), with the last link or pearl connected to the first one.

<image>

You can remove a link or a pearl and insert it between two other existing links or pearls (or between a link and a pearl) on the necklace. This process can be repeated as many times as you like, but you can't throw away any parts.

Can you make the number of links between every two adjacent pearls equal? Two pearls are considered to be adjacent if there is no other pearl between them.

Note that the final necklace should remain as one circular part of the same length as the initial necklace.

Input

The only line of input contains a string s (3 ≤ |s| ≤ 100), representing the necklace, where a dash '-' represents a link and the lowercase English letter 'o' represents a pearl.

Output

Print "YES" if the links and pearls can be rejoined such that the number of links between adjacent pearls is equal. Otherwise print "NO".

You can print each letter in any case (upper or lower).

Examples

Input

<span class="tex-font-style-tt">-o-o--</span>

Output

YES

Input

<span class="tex-font-style-tt">-o---</span>


Output

YES

Input

<span class="tex-font-style-tt">-o---o-</span>


Output

NO

Input

ooo


Output

YES

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;
 
 
 
 
 
 

 
public class ne {
	static class MergeSort
	{
	    // Merges two subarrays of arr[].
	    // First subarray is arr[l..m]
	    // Second subarray is arr[m+1..r]
	    static void merge(int arr[], int l, int m, int r)
	    {
	        // Find sizes of two subarrays to be merged
	        int n1 = m - l + 1;
	        int n2 = r - m;
	 
	        /* Create temp arrays */
	        int L[] = new int [n1];
	        int R[] = new int [n2];
	 
	        /*Copy data to temp arrays*/
	        for (int i=0; i<n1; ++i)
	            L[i] = arr[l + i];
	        for (int j=0; j<n2; ++j)
	            R[j] = arr[m + 1+ j];
	 
	 
	        /* Merge the temp arrays */
	 
	        // Initial indexes of first and second subarrays
	        int i = 0, j = 0;
	 
	        // Initial index of merged subarry array
	        int k = l;
	        while (i < n1 && j < n2)
	        {
	            if (L[i] <= R[j])
	            {
	                arr[k] = L[i];
	                i++;
	            }
	            else
	            {
	                arr[k] = R[j];
	                j++;
	            }
	            k++;
	        }
	 
	        /* Copy remaining elements of L[] if any */
	        while (i < n1)
	        {
	            arr[k] = L[i];
	            i++;
	            k++;
	        }
	 
	        /* Copy remaining elements of R[] if any */
	        while (j < n2)
	        {
	            arr[k] = R[j];
	            j++;
	            k++;
	        }
	    }
	 
	    static // Main function that sorts arr[l..r] using
	    // merge()
	    void sort(int arr[], int l, int r)
	    {
	        if (l < r)
	        {
	            // Find the middle point
	            int m = (l+r)/2;
	 
	            // Sort first and second halves
	            sort(arr, l, m);
	            sort(arr , m+1, r);
	 
	            // Merge the sorted halves
	            merge(arr, l, m, r);
	        }
	    }}
	static class Reader1 {
	    static  BufferedReader reader;
	    static StringTokenizer tokenizer;
 
	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }
 
	    /** get next word */
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }
 
	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
		
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	    static float nextFloat() throws IOException {
	        return Float.parseFloat( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }}
 
	
public static void main(String[] args) throws IOException{
	//System.out.println(fib(1000));
 
	Reader1.init(System.in);
	int count1=0,count2=0;
	String s=Reader1.next();
	for(int i =0;i<s.length();i++)
	{
		if(s.charAt(i)=='o')
			count1++;
		else
			count2++;
		
		
		
	}	if(count1==0)
	
		{
			System.out.println("YES");
		}
	else if(count2%count1==0)
		System.out.println("YES");
	else
		System.out.println("NO");
		
			
		
		
}
	
	
	
	
	
	}