How to replace the 2nd character in a string using sed?

Hi,
i have string var1=NN. Based on conditions, i have to change this first N to Y or second N to Y and send the details to other process. How to do that? This is a linux machine.

Thanks,
Selva

bash has this:
${string:position:length}

var1="NN"
if [[ "$condition1" = "OK" ]] ; then
   tmp="Y""${var1:2:1}"
else
   tmp="${var1:1:1}""Y"
fi 
var1=$tmp

gives YN and NY depending on condition1