Mark Williams overcame a shaky start to beat defending champion Yan Bingtao 6-4 in the first round of the Masters.