Imports System

Module Module1

    Sub Main(args As String())

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

        Try

            For i = 0 To N - 1
                A = CLng(tmp(i))
                If A = 0 Then
                    Console.WriteLine(0)
                    Exit Sub
                End If
                wk = wk * A
            Next

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

            Console.WriteLine(wk)

        Catch ex As Exception

            Do While i <= N - 1
                If CLng(tmp(i)) = 0 Then
                    Console.WriteLine(0)
                    Exit Sub
                End If
                i += 1
            Loop
            Console.WriteLine(-1)

        End Try

    End Sub

End Module

