#include <bits/stdc++.h>
using namespace std;
int cf[120000];
int a[120000];
int hf[120000];
int n;
void po(int x) {
  while (1) {
    if (x == n) {
      printf("0");
      return;
    }
    if (a[x] == 1) {
      printf("%d->", a[x]);
      x++;
    } else {
      printf("%d->", a[x]);
      printf("(");
      for (int i = x + 1; i < n; i++) {
        if (i == n - 1)
          printf("%d", a[i]);
        else
          printf("%d->", a[i]);
      }
      printf(")");
      printf("->0");
      return;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= 110000; i++) cf[i] = 0;
  if (a[n] != 0) {
    printf("NO");
    return 0;
  }
  if (n == 1) {
    printf("YES\n0");
    return 0;
  }
  cf[n] = 1;
  hf[n] = 1;
  for (int i = n - 1; i >= 1; i--) {
    if (a[i] == 1)
      cf[i] = cf[i + 1];
    else {
      cf[i] = hf[i + 2];
    }
    hf[i] = max(cf[i], hf[i + 1]);
  }
  if (cf[1] == 1) {
    printf("YES\n");
    po(1);
  } else {
    printf("NO\n");
    return 0;
  }
}
