On the infinite hierarchies of symmetries and constants of motion for the Kadomtsev—Petviashvili equation