#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int n, q;
int dp[300007][20];
int a[300007];
int last[20];
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int j = 0; j < 19; j++) {
    dp[n][j] = n;
    last[j] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 19; j++) {
      dp[i][j] = n;
    }
    for (int j = 0; j < 19; j++) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < 19; k++) {
          dp[i][k] = min(dp[i][k], dp[last[j]][k]);
        }
        last[j] = i;
        dp[i][j] = i;
      }
    }
  }
  for (int i = 0; i < q; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool good = false;
    for (int j = 0; j < 19; j++) {
      good |= (((a[y] >> j) & 1) && dp[x][j] <= y);
    }
    cout << (good == true ? "Shi" : "Fou") << '\n';
  }
}
