Fermi Large Area Telescope observations of Local Group galaxies: detection of M 31 and search for M 33