java | Please help to understand not return the minimum value : Please help to underdtand why in thefolloiwng i didn't gotintoftheminimum value in array , usering scanner for input value and need when inout -1 the programm shod ouput also the minimun number

thank you


import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int[] list;
		list = new int[10000];
		int sum = 0;
		double avr = 0;
		int min = list [0];
		int max = list [0];
		int x = 0;
		int value;

		Scanner input = new Scanner(System.in);
		System.out.print("Add number " + (x + 1) + ": ");
		value = input.nextInt();

		while (x <= list.length && (value != -1 || x == 0)) {
			list[x] = value;
			x++;
			System.out.print("Add number " + (x + 1) + ": ");
			value = input.nextInt();
		}

		for (int i = 0; i < list.length; i++) {
			sum += list[i];
			avr = sum / x;
			
			if(list[i] > max)
				max = list[i]; 

			if( list[i] < min )
				min = list[i];

		}


		System.out.println("The sum of all values are: " + sum);
		System.out.println("The average value of the numbers are: " + avr);
		System.out.println("The maximum value of the numbers are: " + max);
		System.out.println("The minimum value of the numbers are: " + min);
		

	}

}