We consider a first nontrivial approximation to the generalized Maurer-Cartan equations, related to the deformation theory of BRST operator of string theory. We show that these equations lead to the homotopy Lie algebra of Yang-Mills equations. We also discuss some conjectures about the homotopy structure of Gravity.