A Curious Relation Between Gravity and Yang-Mills Theories