n,a,b,c,d=gets.split.map(&:to_i)
s=gets.chomp.split("").map(&:to_s)
start=[a-1,b-1]
goal=[c-1,d-1]

flag=0
for i in 0..1
    map=s.dup
    map[start[i]]="&"
    step=start[i]
    while step<=goal[i]
        if step==goal[i]
        flag+=1
        break
        end
     if map[step+1]!="#"
         step+=1
         next
     elsif map[step+2]="#"
        step+=2
        next
    end
       
    
    end
end

if flag==2
    puts "Yes"
else
 puts "No"
end
