Hi Olena,
Yes, both of those sentences are correct and very natural.
“Come across” is the phrasal verb that English speakers use to naturally express the idea that learners often use the verb “encounter” for. That is, “find” has a meaning of intention: you meant to search for X and then you succeeded in discovering its location.
“Come across” is used for when you did not mean to search for X, but you discovered it anyway. You “encountered” X. Maybe you *were* searching for Y — “while looking up something else I came across this old newspaper article from the 1950s”.
It’s just that “encountered” isn’t commonly used.