Problem piyush and magical park

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt(), m = cin.nextInt(), k = cin.nextInt(), s = cin.nextInt();
char arr[][] = new char[n][m];
int ans = -1;
for(int i = 0;i<n;i++){
for(int j = 0;j<m;j++){
arr[i][j] = cin.next().charAt(0);
}
}

     for(int i = 0;i<n;i++){
	   for(int j = 0;j<m;j++){
		  if(s>k){
			  if(arr[i][j] == '.'){
			  s--;
			  s -= 2;				  
		  }else if(arr[i][j] == '*'){
			  s--;
			  s += 5; 
		  }else if(arr[i][j] == '#'){
			  s--;
			  break;
		  }
		  }else{
			  ans = 0;
		  }
	   }
   }
   if(s>k){
	    ans =1;
   }else{
       ans = 0;
   }
   if(ans == 0){
	   System.out.print("No");
   }else if (ans == 1){
	   System.out.print("Yes");
   }
}

}====
what’s the error in the code