Under construction

Still being built. Things may change

Tour Course

Time limit2sMemory limit1024 MB

Summary
Given which tourists on a circular route end with affection at least 1, build a snowfield or desert pattern for the N segments, or report NO if none exists.
Level

Medium7 of 10

Topics
Prefix sum, String, Implementation
Solved
No attempts yet

Problem

The UCPC Kingdom has a circular tour route made of NN segments that together cover the whole kingdom. Each segment has a shuttle bus to the next segment. From segment ii with 1≤i<N1\leq i<N, you can move to segment i+1i+1, and from segment NN you can move to segment 11.

Now NN tourists from the Arctic will tour the UCPC Kingdom on this route. The ii-th tourist starts at segment ii and rides the shuttle buses to tour NN segments in total.

Each segment is either a snowfield or a desert. Every tourist starts at their starting point with an affection of 11. Each time they pass a snowfield segment, their affection increases by 11, and each time they pass a desert segment, it decreases by 11. If the affection reaches 00 during the tour, the tourist stops immediately and leaves for their home country. After touring all NN segments, a tourist whose affection is at least 11 buys an expensive souvenir from the UCPC Kingdom and returns home.

You live in the Arctic and know which tourists bought a souvenir. Use that information to work out the structure of the tour route. Given the purchase status of tourists 1 through NN, print one possible structure of the route.

Output

If a route exists for the given input, print YES on the first line and a string of length NN on the second line. The ii-th character is + if segment ii is a snowfield and - if it is a desert.

If no route exists, print NO on the first line.

Input

The first line contains NN (1≤N≤500 0001\leq N\leq 500\,000). The second line contains a string of length NN. The ii-th character is O if tourist ii bought a souvenir and X if not.

Examples3

  1. Example 1

    Input
    5
    OXOXO
    
    Expected output
    YES
    +-+-+
    
  2. Example 2

    Input
    6
    XXXXXX
    
    Expected output
    YES
    +--+--
    
  3. Example 3

    Input
    5
    XXXOX
    
    Expected output
    NO