Python (Simple Dynamic Programming)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def firstDayBeenInAllRooms(self, nextVisit):\n        n, mod = len(nextVisit), 10**9 + 7\n        dp = [0]*n \n\n        for i in range(1,n):\n            dp[i] = (dp[i-1] + (dp[i-1] - dp[nextVisit[i-1]] + 1) + 1)%mod\n\n        return dp[-1]\n\n\n\n\n        \n        \n        \n        \n```
['Python3']