According to many Rabbinical Authorities you are only allowed to leave Eretz Yisroel if you have a valid reason. For example Parnasa (livelihood). What other reasons are valid for one to be able to leave Eretz Yisroel?
From Rambam Hilchot Melachim 5:9 (emphasis mine):
It is forbidden to leave Eretz Yisrael for the Diaspora at all times except:
to study Torah;
to marry; or
to save one's property from the gentiles.
After accomplishing these objectives, one must return to Eretz Yisrael.
Similarly, one may leave Eretz Yisrael to conduct commercial enterprises. However, it is forbidden to leave with the intent of settling permanently in the Diaspora unless the famine in Eretz Yisrael is so severe that a dinar's worth of wheat is sold at two dinarim.
When do these conditions apply? When one possesses financial resources and food is expensive. However, if food is inexpensive, but a person cannot find financial resources or employment and has no money available, he may leave and go to any place where he can find relief.
Though it is permitted to leave Eretz Yisrael under these circumstances, it is not pious behavior. Behold, Machlon and Kilyon were two of the great men of the generation and they left Eretz Yisrael only out of great distress. Nevertheless, they were found worthy of death by God.
The Gemara says to learn Torah (if you have a better Rebbe in Chutz La'Eretz) or to marry. But I imagine that there are conditions to be met for this.
I would assume that health reasons would similarly be allowed.
And as I wrote here R Shmuel Halevi Wosner allows vacation for a constructive purpose such as seeing the wonders and beautiful parts of Hashem’s creation or resting (when this cannot be easily achieved in Israel).
If you came to E"Y on condition that you wouldn't have to stay there in the first place, then yes- you could leave.