Given a sorted array of positive integers containing duplicates, design an algorithm and implement it using a program to find whether a given key element is present or not.