Let G be a 2-connected n-vertex graph and Ns(G) be the total number of s-cliques in G. Let k ≥ 4 and s ≥ 2 be integers. In this paper, we show that if G has an edge e which is not on any cycle of length at least k, then Ns(G) ≤ r k−1 s + t+2 s , where n − 2 = r(k − 3) + t and 0 ≤ t ≤ k − 4. This result settles a conjecture of Ma and Yuan and provides a clique version of a theorem of Fan, Wang and Lv. As a direct corollary, if Ns(G) > r k−1 s + t+2 s , every edge of G is covered by a cycle of length at least k.