Yes, it is one of the best ways to prove the novelty of your invention is patent. The government does not approve a patent unless your invention is novel.