It is proved, that, in order to avoid the ghost mode in bigravity theory, it is sufficient to impose four conditions on the potential of interaction of the two metrics. First, the potential should allow its expression as a function of components of the two metrics' 3+1-decomposition. Second, the potential must satisfy the first order linear differential equations which are necessary for the presence of four first class constraints in bigravity. Third, the potential should be a solution of the Monge-Ampère equation, where the lapse and shift are considered as variables. Fourth, the potential must have a nondegenerate Hessian in the shift variables. The proof is based on the explicit derivation of the Hamiltonian constraints, the construction of Dirac brackets on the base of a part of these constraints, and calculation of other constraints' algebra in these Dirac brackets. As a byproduct, we prove that these conditions are also sufficient in the massive gravity case.