#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
    int data;
    struct node*next;
    struct node*prev;
}Node;
Node *head=NULL,*tail;
void  create(int num)
{
    Node*newNode=(Node*)malloc(1*sizeof(Node));
    newNode->data=num;
    newNode->next=NULL;
    newNode->prev =NULL;
    if(head==NULL)
    {
        head=newNode;
        tail=newNode;
    }
    else
    {
        tail->next=newNode;
        newNode->next=tail;
        tail=newNode;
    }
}
void display()
{
   Node*i;
   for(i=tail;i>0;i=i->prev)
   {
       printf("%d",&itr->data);
   }
   printf("Yes");
}
int main()
{
    int n,i,num;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&num);
        if(num==-1)
        {
            break;
        }
        create(num);
    }
    display();
}