#include <stdio.h>

int main(void)
{
  long long int n;
  long long int a[1000000];
  long long int ans1=1;
  long long int ans2=1;
  long long int flag=1;
  scanf("%lld", &n);
  for(long long int i=1;i<=n;i++){
    scanf("%lld", &a[i]);
    ans1 = ans1*a[i];
    if(a[i]==0){
      flag = flag*0;
    }
  }
  for(long long int i=1;i<n;i++){
    ans2 = ans2*a[i];
    if(ans2>=1000000000000000000){
      flag = flag*2;
      break;
    }
  }
  printf("%lld\n", flag);
  switch(flag){
  case 1:
    printf("%lld\n", ans1);
    break;
  case 2:
    printf("-1\n");
    break;
  case 0:
    printf("0\n");
    break;
  }
  return 0;
}
