program read
  implicit none
  integer n
  integer, allocatable::data(:)
  integer :: i
  integer :: flag = 0
  integer :: ans = 1
  
  read *, n
  
  allocate(data(n))
  
  do i = 1,n
  read *, data(i)
  if (data(i)==0 ) then
  flag = 1
  end if
  end do
  
  if (flag == o) then
  	do i = 1,n
    ans = ans*data(i)
    end do
  else
  	ans = 0
  end if
  
  print *, ans
end program read
