Imports System

Module Program
    Sub Main(args As String())

        Dim N As Integer = Console.ReadLine()
        Dim tmp As String() = Split(Console.ReadLine(), " ")
        Dim A(N) As Long
        Dim wk As Long = 1

        For i As Integer = 0 To N - 1
            A(i) = CLng(tmp(i))
            If A(i) = 0 Then
                Console.WriteLine(0)
                Exit Sub
            End If
            If wk <= CLng(10 ^ 18) Then
                If Len(CStr(wk) & CStr(A(i))) <= 20 Then
                    wk = wk * A(i)
                End If
            End If
        Next

        If wk > CLng(10 ^ 18) Then
            Console.WriteLine(-1)
            Exit Sub
        End If

        Console.WriteLine(wk)

    End Sub

End Module
