The ELM (edge localized mode) mitigation by SMBI (supersonic molecular beam injection) has been studied in the HL-2A H-mode plasmas. The ELM mitigation effect and its relationship with the deposition position of SMBI in the H-mode pedestal are reported for the first time experimentally. We found that when the deposition of SMBI is about 20% into the pedestal, the best ELM mitigation effect is achieved, which is identified by a significant increase of the ELM frequency and also a decrease of the ELM amplitude. The theoretical inference that no deep injection is needed is confirmed. The sand-pile model is used to simulate the ELM burst and explain the mitigation effect for different SMBI deposited positions. It is found that the gradient threshold is a key parameter in the process of the ELM mitigation, and there should be a local gradient threshold in the middle of the pedestal. When the deposition of SMBI is close to the edge of this region, the best ELM mitigation effect can be observed.