#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int *a=new int[n];
int *monotone = new int[n];//单调性数组
int count = 0;//单调性改变次数
//画图的功能是额外的,不影响判断
int *draw = new int[n];//画图辅助数组
int max = 0;//画图辅助
int min = 0;
for(int i=0;i<n;i++){
cin >> a[i];
}
if(n==1){
cout<<"Yes"<<endl;
}else{
monotone[0] = 0;
for(int i=1;i<n;i++){
if(a[i] - a[i-1]){
monotone[i] = a[i] > a[i-1]?1:-1;
}else{
monotone[i] = 0;
}
if(monotone[i]*monotone[i-1]<0){
count++;
}
}
}
//这部分是我自己加的画图,不影响整体判断功能
draw[0] = 0;
for(int i=1;i<n;i++){
draw[i] = monotone[i] + draw[i-1];
if(draw[i]>max){
max=draw[i];
}
if(draw[i]<min){
min=draw[i];
}
}
for(int i=max;i>=min;i--){
for(int j=0;j<n;j++){
if(draw[j] == i){
if(monotone[j]>0){
cout<<"/ ";
}
if(monotone[j]==0){
cout<<"- ";
}
if(monotone[j]<0){
cout<<"\\ ";
}
}else{
cout<<" ";
}
}
cout<<endl;
}
//根据单调性改变次数判断是否为近序数组
if(count>1){
cout<<"No"<<endl;
}else{
cout<<"Yes"<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKXsKCWludCBuOwoJY2luID4+IG47CglpbnQgKmE9bmV3IGludFtuXTsKCWludCAqbW9ub3RvbmUgPSBuZXcgaW50W25dOy8v5Y2V6LCD5oCn5pWw57uECglpbnQgY291bnQgPSAwOy8v5Y2V6LCD5oCn5pS55Y+Y5qyh5pWwIAoJLy/nlLvlm77nmoTlip/og73mmK/pop3lpJbnmoTvvIzkuI3lvbHlk43liKTmlq0KCWludCAqZHJhdyA9IG5ldyBpbnRbbl07Ly/nlLvlm77ovoXliqnmlbDnu4QKCWludCBtYXggPSAwOy8v55S75Zu+6L6F5YqpCglpbnQgbWluID0gMDsKCQoJZm9yKGludCBpPTA7aTx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