Nobody knows the answer to your question. We all have our opinions (this being Chess.com, they are strong opinions!) but there have been no scientific tests. Why don't you devote the next year or two to trying and then let us know your results?
Can i attain the FM title only by studying masters games?
"... In order to maximize the benefits of [theory and practice], these two should be approached in a balanced manner. ... Play as many slow games (60 5 or preferably slower) as possible, ... The other side of improvement is theory. ... This can be reading books, taking lessons, watching videos, doing problems on software, etc. ..." - NM Dan Heisman (2002)
https://web.archive.org/web/20140627084053/http://www.chesscafe.com/text/heisman19.pdf
"... When you get to apply - in a real game - what you've learned from a book or computer screen, the information is reinforced in a powerful way." - GM Andrew Soltis (2009)
On Jan 28, 2015, a player (who got over 2300) told us about his start:
"... when I was a kid (10 or 11) playing in USCF events for the first time, I just wanted to PLAY. I didn't care if I got smoked or not ..."
I am wondering if i can attain a title by only studying masters games.
The IM title is a performance-based title.Thus you can not obtain it just by studying no matter what you study. You also need to play, and you need to play in tournaments. Get more information and experience in a chess club.

You also need to study tactics and positions. Without them, it's like trying to do a job without knowing what tools are available to you. When I study masters games, I try to understand how they saw or caused a position to appear where a combination/tactic could be carried out.
You should be able to demonstrate from memory and name all of these tactical and positional motifs - learn a few at a time:
https://www.chess.com/article/view/chess-tactics
https://chesstempo.com/tactical-motifs
https://chesstempo.com/positional-motifs
And that's just the start for working toward FM!
What It Takes to Become a Chess Master by Andrew Soltis
"... going from good at tactics to great at tactics ... doesn't translate into much greater strength. ... You need a relatively good memory to reach average strength. But a much better memory isn't going to make you a master. ... there's a powerful law of diminishing returns in chess calculation, ... Your rating may have been steadily rising when suddenly it stops. ... One explanation for the wall is that most players got to where they are by learning how to not lose. ... Mastering chess ... requires a new set of skills and traits. ... Many of these attributes are kinds of know-how, such as understanding when to change the pawn structure or what a positionally won game looks like and how to deal with it. Some are habits, like always looking for targets. Others are refined senses, like recognizing a critical middlegame moment or feeling when time is on your side and when it isn't. ..." - GM Andrew Soltis (2012)
https://web.archive.org/web/20140708093409/https://www.chesscafe.com/text/review857.pdf
100 Chess Master Trade Secrets by Andrew Soltis
https://web.archive.org/web/20140708094523/https://www.chesscafe.com/text/review916.pdf
Reaching the Top?! by Peter Kurzdorfer
"... On the one hand, your play needs to be purposeful much of the time; the ability to navigate through many different types of positions needs to be yours; your ability to calculate variations and find candidate moves needs to be present in at least an embryonic stage. On the other hand, it will be heart-warming and perhaps inspiring to realize that you do not need to give up blunders or misconceptions or a poor memory or sloppy calculating habits; that you do not need to know all the latest opening variations, or even know what they are called. You do not have to memorize hundreds of endgame positions or instantly recognize the proper procedure in a variety of pawn structures.
[To play at a master level consistently] is not an easy task, to be sure ..., but it is a possible one. ..." - NM Peter Kurzdorfer (2015)
https://www.thechessmind.net/blog/2015/11/16/book-notice-kurzdorfers-reaching-the-top.html
https://www.jeremysilman.com/shop/pc/Reaching-the-Top-77p3905.htm
"Yes, you can easily become a master. All you need to do is some serious, focused work on your play.
That 'chess is 99% tactics and blah-blah' thing is crap. Chess is several things (opening, endgame, middlegame strategy, positional play, tactics, psychology, time management...) which should be treated properly as a whole. getting just one element of lay and working exclusively on it is of very doubtful value, and at worst it may well turn out being a waste of time." - IM pfren (August 21, 2017)
"Every now and then someone advances the idea that one may gain success in chess by using shortcuts. 'Chess is 99% tactics' - proclaims one expert, suggesting that strategic understanding is overrated; 'Improvement in chess is all about opening knowledge' - declares another. A third self-appointed authority asserts that a thorough knowledge of endings is the key to becoming a master; while his expert-friend is puzzled by the mere thought that a player can achieve anything at all without championing pawn structures.
To me, such statements seem futile. You can't hope to gain mastery of any subject by specializing in only parts of it. ..." - FM Amatzia Avni (2008)
There is no substitute for actual play. Preferably, over-the-board, tournament play.
If you mean "Do I need to take lessons?", then no, of course not.