Tree-level S matrix of Yang-Mills theory